0; } function addToTable($lat, $lon, $url, $table, $conn) { if (is_numeric($lat) == false || is_numeric($lon) == false || $lat > 180 || $lat < -180 || $lon > 180 || $lon < -180) { return false; } $sql = "INSERT INTO `" . $table . "` (`id`, `location`, `url`, `date_added`) VALUES (NULL, GeomFromText('POINT(" . $lon ." " . $lat . ")',4326), 'test', CURRENT_TIMESTAMP)"; //printf($sql); $res = mysqli_query($conn, $sql); //($res) ? printf("true") : printf("false"); return $res; } ?>