Reputation: 2299
Recieved this error from the below method?
2013-10-02T14:20:05+01:00 ERR (3): exception 'Zend_Db_Table_Select_Exception' with message 'Select query cannot join with another table' in /usr/share/php/Zend/Db/Table/Select.php:215
class Application_Model_DbTable_Provenir extends Zend_Db_Table_Abstract {
protected $_name = 'provenir_instance_response';
protected $_primary = 'provenir_response_id';
protected $_sequence = true;
/**
* Get passed result and check ID
* @param string $memId
* @return Zend_Db_Table
*/
public function scoreCardQuery($memId){
//Build Query
$select = $this->select();
$select->from('scorecard_results', array('passed', 'check_id'));
$select->where('traveller_id=?', $memId);
return $this->fetchAll($select);
}
}
There is no join there? :S
Is it because I am referencing provenir_instance_response
as the DB table in the class argument butI am trying select from scorecard_results
?
Upvotes: 0
Views: 512
Reputation: 2299
/**
* Get passed result and check ID
* @param string $memId
* @return Zend_Db_Table
*/
public function scoreCardQuery($memId){
//Build Query
$select = $this->select();
$select->setIntegrityCheck(false); //Must be set for this query to work
$select->from('scorecard_results', array('passed', 'check_id'));
$select->where('traveller_id=?', $memId);
return $this->fetchAll($select);
}
Upvotes: 1