Since a while I am trying to remove the quotes of my mysql query in a ZF2 application. I need to remove the quotes to make this query works, testing the query over command line succeeded by removing the quotes around GEODIST().
$adapter = $serviceLocator->get('SphinxSearch\Db\Adapter\Adapter');
$sql = new Sql($adapter);
$select = new Select;
$select ->columns(array('*', 'distance' => 'GEODIST(23.3556740442177, 2.9525189115381, latitude, longitude)'))
->from('table_name')
->where(array('distance > ?' => 250000))
->order('distance ASC')
->limit(25);
echo $select->getSqlString(new SphinxQL());
Outputs
SELECT *, `GEODIST(23.3556740442177, 2.9525189115381, latitude, longitude)` AS `distance` FROM `table_name` ORDER BY `distance` ASC LIMIT 0,25