gpstools/setup.php

20 lines
411 B
PHP
Raw Normal View History

2016-01-15 07:11:36 +00:00
<?php
require_once("config.php");
2016-01-15 07:11:36 +00:00
$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));
2016-01-15 07:11:36 +00:00
}
mysqli_close($conn);
echo "OK";