I'm trying to create a location tracking app. Its for contact tracing and notification for small business or company and want a local tracker(School project). I am having difficulty uploading the data to the database. im using PHP and SQL. im not very experienced so i cant quite figure out where the disconnect is. I know its connecting but nothing is uploading
indent preformatted text by 4 spaces
<?php
DEFINE ('DBUSER', 'id16511857_aggies2020');
DEFINE ('DBPW', 'N#b9A]lD[2cbq(AV');
DEFINE ('DBHOST', 'localhost');
DEFINE ('DBNAME', 'id16511857_raw_data');
$dbc = mysqli_connect(DBHOST,DBUSER,DBPW);
if (!$dbc) {
die("Database connection failed: " . mysqli_error($dbc));
exit();
}
$dbs = mysqli_select_db($dbc, DBNAME);
if (!$dbs) {
die("Database selection failed: " . mysqli_error($dbc));
exit();
}
$phNum = mysqli_real_escape_string($dbc, $_GET['phNum']);
$lat = mysqli_real_escape_string($dbc,$_GET['lat']);
$long = mysqli_real_escape_string($dbc,$_GET['long']);
$alt = mysqli_real_escape_string($dbc,$_GET['alt']);
$time = mysqli_real_escape_string($dbc,$_GET['time']);
$date = mysqli_real_escape_string($dbc,$_GET['date']);
$query = "INSERT INTO location (phNum, lat, long, alt, time, date) VALUES ('$phNum', '$lat', '$long', '$alt', '$time', '$date')";
$result = mysqli_query($dbc, $query) or trigger_error("Query MySQL Error: " . mysqli_error($dbc));
mysqli_close($dbc);
?>