gpstools/setup.php
2016-01-16 13:17:02 +01:00

19 lines
411 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 tracker ( ts TIMESTAMP PRIMARY KEY DEFAULT CURRENT_TIMESTAMP, lat DOUBLE, lon DOUBLE );";
if (!mysqli_query($conn, $sql)) {
die('Error: ' . mysqli_error($conn));
}
mysqli_close($conn);
echo "OK";