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