0

I have the following code in a zend db query

->join(array('z' => new Zend_Db_Expr('(' . $this->_dbhInstance->select()->from('zipcode', array('lat', 'lon', 'zip'))
                    ->group('zip') . ')')), 'zip = f.zipcode')
        ->join(array('distance' => new Zend_Db_Expr('(SELECT GetDistance(' . $lat . ',' . $lon . ',z.lat,z.lon) as distance)')))

The issue is that z.lat,z.lon is not getting the values from the previous join (>join(array('z'), it just uses the actual text.

How can I format z.lat,z.lon) to grab the values from >join(array('z' ?

1 Answers1

0

This is not working because Join has tree parameter

->join(tableName,joinCondition,fetchParameters)

but you have wrote only two...

Nilesh Gupta
  • 367
  • 1
  • 2