Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. $server = "localhost";
  4. $username = "artyfici_titcumb";
  5. $password = "gdyj36E8kw";
  6.  
  7. $con = mysql_connect($server, $username, $password) or die (mysql_error());
  8. mysql_select_db('artyfici_portfolio', $con) or die (mysql_error());
  9.  
  10. $query = "SELECT * FROM idat102FlashScores ORDER BY playerScore DESC";
  11. $result = mysql_query($query) or die (mysql_error());
  12.  
  13. ////////////////////////////////////////////////////////////////////////
  14.  
  15. $body = "";
  16.  
  17. // table headers
  18. echo "<table width="200">;
  19. echo "<tr>";
  20.     echo "<th>Name</th>";
  21.     echo "<th>Score</th>";
  22. echo "</tr>";
  23.  
  24. while($row = mysql_fetch_array($result)){
  25.     $name = $row['playerName'];
  26.     $score = $row ['playerScore'];
  27.     echo "<tr>";
  28.         echo "<td>$name</td>";
  29.         echo "<td>$score</td>";
  30.     echo "</tr>";
  31. }
  32.  
  33. // table footers
  34. echo "</table>";
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement