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
Post a Comment