0

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?

1 Answer 1

1
/**
 * 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);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.