$art=M("Article");
$where['cid']=$cid;
$list=$art->join('catgory on article.cid=catgory.cid')->where($where)->limit($Page->firstRow.','.$Page->listRows)->order('ctime desc')->select();
查询出来的语句是:
SELECT * FROM `article` LEFT JOIN catgory on article.cid=catgory.cid WHERE ( `cid` = 2 ) AND ( `status` = 1 ) ORDER BY ctime desc LIMIT 0,10 ;
sql报错:Column 'cid' in where clause is ambiguous [ SQL语句 ] : SELECT * FROM `article` LEFT JOIN catgory on article.cid=catgory.cid WHERE ( `cid` = 2 ) AND ( `status` = 1 ) ORDER BY ctime desc LIMIT 0,10;求大神给予指导,万分感谢,谢谢
最佳答案