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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -