Guest User

Untitled

a guest
Oct 18th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "";
  4. $password = "";
  5. $dbname = "";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $sql = "SELECT id, timestamp, ip, dl, ul, ping, jitter FROM speedtest_users";
  15. $result = $conn->query($sql);
  16.  
  17. if ($result->num_rows > 0) {
  18. // output data of each row
  19. while($row = $result->fetch_assoc()) {
  20. echo "SL: " . $row["id"]. " - Time: " . $row["timestamp"]. " - IP: " . $row["ip"]. " - DL: " . $row["dl"]. " - UL: " . $row["ul"]. " - PING: " . $row["ping"]. " - JITTER: " . $row["jitter"]. " " . $row["lastname"]. "<br>";
  21. }
  22. } else {
  23. echo "0 results";
  24. }
  25. $conn->close();
  26. ?>
Add Comment
Please, Sign In to add comment