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());    

我正在写上面的查询,但有些没有给我错误

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

谁能告诉我可能的原因是什么?

4

1 回答 1

1

尝试设置:


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

希望有帮助

于 2012-04-16T07:48:02.287 回答