Fix variable name, change include to require

This commit is contained in:
Klaus-Uwe Mitterer 2016-01-16 13:17:02 +01:00
parent f65958a859
commit 6cb4dc7429

View file

@ -1,6 +1,6 @@
<?php
include_once("config.php");
require_once("config.php");
$conn = new mysqli($servername, $username, $password, $dbname);
@ -10,8 +10,8 @@ if ($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));
if (!mysqli_query($conn, $sql)) {
die('Error: ' . mysqli_error($conn));
}
mysqli_close($conn);