$bl_admin=M('t1')->alias('a')->join('t2 as b on b.uid = a.uid')->select(); 两张表查询 $bl_comment=M('t1')->alias('a')->join('t2 as b on a.uid = b.uid', 'left')->join('t3 as c on b.uid = c.uid', 'left')->select(); 三张表查询
博客列表 >Thinkphp连表查询
$bl_admin=M('t1')->alias('a')->join('t2 as b on b.uid = a.uid')->select(); 两张表查询 $bl_comment=M('t1')->alias('a')->join('t2 as b on a.uid = b.uid', 'left')->join('t3 as c on b.uid = c.uid', 'left')->select(); 三张表查询