How to use POINT mysql type with mysqli - php -


this question has answer here:

based on this table php .net :

 type specification chars character   description   corresponding variable has type integer d   corresponding variable has type double s   corresponding variable has type string b   corresponding variable blob , sent in packets 

i write code:

$stmt = $this->conn->prepare("insert days(day,startlocation) values(?,?)");         $stmt->bind_param("ss", $day, $startlocation); 

but problem becouse startlocation field in database use type point,

how can make bind_param point datatype in mysql?

you should use mysql function point in order convert latitude/longitude

$stmt = $this->conn->prepare("insert days(day,point(lat,lon)) values(?,?,?)");         $stmt->bind_param("sdd", $day, $lat, $lon); 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -