0
Table : sc_message 
  ______________________________________________________________________
 |message_id | message_sender_id | message_receiver_id | message_content|
 ------------------------------------------------------------------------  

Table : sc_user 
  _____________________
 | user_id | user_name |
 ----------------------- 
$Query_1 = $this ->select()
                 ->from(array('msg' => 'sc_message'), array('msg.message_sender_id, msg.message_receiver_id, msg.message_content, msg.message_sent_on'))
                 ->join(array('usr' => 'sc_user'), 'msg.message_sender_id = usr.user_id', array('usr.user_name as sender_name'))
                 ->where('msg.message_id = ?',$message_id)
                 ->order('msg.message_sent_on');

die($Query_1->__toString());    

I am writing above query but some how it is not giving me error

  Warning: Select query cannot join with another table in E:\wamp\www\social_site\library\Zend\Db\Select.php on line 1222

can anyone tell me what can be the probable reason?

0

1 Answer 1

1

Try setting:


$this->setIntegrityCheck(false); //after select() line

Hope that helps

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.