多表相同字段名查询出错

浏览:984 发布日期:2016/04/05 分类:求助交流 关键字: 多表查询 相同字段 join
tablea
id,uname,pid

tableb
id,age,pid,aid

查询语句
$where['pid']=1;
$db=M('tablea');
$db->alias('a');
$db->join('__TABLEB__ b on a.id=b.aid');
$rs=$db->where($where)->select();

显示Column 'pid' in where clause is ambiguous
最佳答案
评论( 相关
后面还有条评论,点击查看>>