gpstools/setup.php
Klaus-Uwe Mitterer f65958a859 Inital stuff
2016-01-15 08:11:36 +01:00

19 lines
408 B
PHP

<?php
include_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($con,$sql)) {
die('Error: ' . mysqli_error($con));
}
mysqli_close($conn);
echo "OK";