Php zend框架与空间

Php zend框架与空间,php,zend-framework,spatial,Php,Zend Framework,Spatial,我正在使用zend框架和MySQL。我正在使用Zend_Db_Table_Abstract运行查询。 我在表中有一个空间字段: 国家: 我试图在此表中插入记录,但出现错误: Zend_Db_Statement_Exception: SQLSTATE[22003]: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY field . 据此: $this->

我正在使用zend框架和MySQL。我正在使用Zend_Db_Table_Abstract运行查询。 我在表中有一个空间字段:

国家: 我试图在此表中插入记录,但出现错误:

Zend_Db_Statement_Exception: SQLSTATE[22003]: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY field .
据此:

$this->insert(array('region_id'=>'1','coordinate'=>"GeomFromText( 'POINT(-12.461334 130.841904)'"));

有人能帮忙吗?

蜥蜴比尔答对了(是的,奥利弗……他在第2行的意思是“$坐标”,而不是“$空间”)

$coordinate  = "GeomFromText( 'POINT(-12.461334 130.841904)')"; 

$this->insert(array('region_id'=>'1','coordinate'=>new Zend_Db_Expr($coordinate)));
我希望我的代码都包含在一个表达式中,因此我使用了以下表达式:

$this->insert(array(
'region_id'=>'1',
'coordinate'=>new Zend_Db_Expr("GeomFromText( 'POINT(-12.461334 130.841904)')")
));

谢谢,这对我也有帮助,我想你的回答是$coordinate
$this->insert(array(
'region_id'=>'1',
'coordinate'=>new Zend_Db_Expr("GeomFromText( 'POINT(-12.461334 130.841904)')")
));