I am trying to store longitude and latitude in a mysql table of datatype POINT using following code:-
$name = $_POST['name']
$lat = $_POST['lat'];
$long = $_POST['longi'];
$location = 'POINT('.$lat."".$long.')';
$sql = "insert into `metrix` (`name`, `coord`) values ('".$name.", '".$location."')";
$result = mysqli_query($con,$sql);
if (empty($result)) {
Echo mysqli_error($con);}
and it gives following MySql syntax error:-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POINT(13,132)')' at line 1
What is the correct way of doing this?
thank you
".$location."