2016-01-15 07:11:36 +00:00
|
|
|
<?php
|
|
|
|
|
2016-01-16 12:17:02 +00:00
|
|
|
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 );";
|
|
|
|
|
2016-01-16 12:17:02 +00:00
|
|
|
if (!mysqli_query($conn, $sql)) {
|
|
|
|
die('Error: ' . mysqli_error($conn));
|
2016-01-15 07:11:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mysqli_close($conn);
|
|
|
|
|
|
|
|
echo "OK";
|