【发布时间】:2012-01-14 21:08:48
【问题描述】:
有没有办法使用准备好的语句将 GIS 数据插入 mysql 数据库(使用 PHP / PDO)?
这失败了:
$stmt = $sql->prepare("INSERT INTO geo SET location= :loc");
$sql->execute($stmt,array('loc'=>"PointFromText('POINT(43.5499152 7.0232372)')"));
其中 geo.location 列的类型为 POINT。
【问题讨论】:
-
注意:在示例中,有时loc可以为NULL...