"; echo ""; echo ""; echo ""; echo ""; echo ""; } ?>
"; echo $row["date_added"]; echo ""; echo $row["Latitude"]; echo ""; echo $row["Longtitude"]; echo ""; echo ""; echo "
0; } function addToTable($lat, $lon, $url, $table, $conn) { settype($lat, "double"); settype($lon, "double"); $sql = "INSERT INTO `" . $table . "` (`id`, `location`, `url`, `date_added`) VALUES (NULL, GeomFromText('POINT(" . $lon ." " . $lat . ")',4326), 'test', CURRENT_TIMESTAMP)"; //$sql = mysqli_real_escape_string($conn, $sql); //printf($sql); $res = mysqli_query($conn, $sql); //($res) ? printf("true") : printf("false"); } 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; } ?>