"; echo ""; echo ""; echo ""; echo ""; echo ""; } ?>
Date AddedLatitudeLongtitudeImage
"; echo $row["date_added"]; echo ""; echo $row["Latitude"]; echo ""; echo $row["Longtitude"]; echo ""; echo ""; echo "
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; } function getList($conn, $table) { $sql = "SELECT *, X(location) as Longtitude, Y(location) as Latitude FROM `$table`;"; //print_r($sql); $res = mysqli_query($conn, $sql); //($res) ? printf("true") : printf("false"); $list = array(); while($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) { $list[] = $row; } return $list; } ?>