Advertisement
Guest User

Untitled

a guest
May 16th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <?php
  6.  
  7. $servername = "localhost";
  8. $username = "mifreecy_mercher";
  9. $password = "swag17";
  10. $dbname = "mifreecy_mercher";
  11.  
  12. // Create connection
  13. $conn = new mysqli($servername, $username, $password, $dbname);
  14. // Check connection
  15. if ($conn->connect_error) {
  16.     die("Connection failed: " . $conn->connect_error);
  17.     echo "failed";
  18. }
  19.  
  20. $result = mysql_query("SELECT playername, profit, runtime
  21.                       FROM connections");
  22. $to_encode = array();
  23. while($row = mysql_fetch_assoc($result)) {
  24.   $to_encode[] = $row;
  25. }
  26. echo json_encode($to_encode);
  27. ?>
  28.  
  29. </body>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement