I have this query below which I am trying to port to Zend (even further below lol). I am getting this error:
Uncaught exception 'Zend_Db_Table_Row_Exception' with message 'Specified column "admin_vfname" is not in the row'
But when I echo the $select and copy the sql into Navicat it runs fine? What is wrong with it because I can't clearly identify it?
SELECT `pay_administrator_actions`.*, `pay_administrator_actions`.*
FROM `pay_administrator_actions`
INNER JOIN `pay_administrator`
ON pay_administrator.admin_uid = pay_administrator_actions.admin_uid
WHERE (CONCAT(pay_administrator.admin_vfname, pay_administrator.admin_vlname) LIKE '%Daly%')
LIMIT 10
public function findActionsByName($name, $page, $rowCount)
{
$name = '%'.$name.'%';
$select = $this->select();
$select->setIntegrityCheck(false);
$select->from('pay_administrator_actions');
$select->join('pay_administrator', 'pay_administrator.admin_uid = pay_administrator_actions.admin_uid', 'pay_administrator_actions.*');
$select->where('CONCAT(pay_administrator.admin_vfname, pay_administrator.admin_vlname) LIKE ?', $name);
$select->limitPage($page, $rowCount);
return $this->fetchAll($select);
}
So as per my comment you need to change pay_administrator_actions.*
to pay_administrator.*
in your join.
$select->join('pay_administrator', 'pay_administrator.admin_uid =
pay_administrator_actions.admin_uid', 'pay_administrator.*');