你好我使用笨加入为什么我不能使用笨括号连接查询
$this->db->join
我用
$this->db->join ($table2 . " as c","(c.3rdPartyID=a.ShopID OR c.3rdPartyID=a.ParentID OR c.ShopID=a.ShopID OR c.ShopID=a.ParentID) AND c.3rdPartyID !=0 ", 'left');
,我也试图与
$join_query = "(c.3rdPartyID=a.ShopID OR c.3rdPartyID=a.ParentID OR c.ShopID=a.ShopID OR c.ShopID=a.ParentID) AND c.3rdPartyID !=0 ";
$this->db->join ($table2 . " as c",$join_query, 'left');
它给一个错误 。
但出括号它工作得很好,像这样
$this->db->join ($table2 . " as c"," c.3rdPartyID=a.ShopID OR c.3rdPartyID=a.ParentID OR c.ShopID=a.ShopID OR c.ShopID=a.ParentID AND c.3rdPartyID !=0 ", 'left');
但对我来说,我需要括号,我应该去正规的MySQL查询,是这样做的codeignier不能,请帮助.. 。
这是错误
,如果你认为它应该工作,请使用输出$完整的SQL语句这个 - > DB-> last_query(),并张贴在这里给我们看 – jmadsen 2013-02-19 03:22:00