17 lines
572 B
PHP
17 lines
572 B
PHP
<?php
|
|
|
|
require_once("config.php");
|
|
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
|
|
if ($conn->connect_error) {
|
|
die("Connection failed: " . $conn->connect_error);
|
|
}
|
|
|
|
$sql = "CREATE TABLE IF NOT EXISTS `speedtest` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ip` text NOT NULL, `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `down` text NOT NULL, `up` text NOT NULL, `ping` text NOT NULL, `jitter` text NOT NULL, `ua` text, PRIMARY KEY (`id`) );"
|
|
|
|
if (!mysqli_query($conn, $sql)) die('Error: ' . mysqli_error($conn));
|
|
|
|
mysqli_close($conn);
|
|
|
|
echo "OK";
|