speedtest/setup.php

18 lines
572 B
PHP
Raw Normal View History

2017-08-06 18:43:07 +00:00
<?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";