Skip to content

Instantly share code, notes, and snippets.

@SystemRestored
Last active October 18, 2017 03:54
Show Gist options
  • Save SystemRestored/523260db755d93a0647a78dad473d977 to your computer and use it in GitHub Desktop.
Save SystemRestored/523260db755d93a0647a78dad473d977 to your computer and use it in GitHub Desktop.
This will display a row of telemetry.. that was not in the original code
<?php
$servername = "localhost";
$username = "";
$password = "";
$dbname = "";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, timestamp, ip, dl, ul, ping, jitter FROM speedtest_users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
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>";
}
} else {
echo "0 results";
}
$conn->close();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment