table
1
|
$list = M()->table( ‘user1 a, user2 b‘ )->where( ‘a.id = b.id‘ )->field( ‘a.name,b.sex‘ )->order( ‘a.id desc‘ )->select(); |
join
1
2
|
$pre = C( ‘DB_PREFIX‘ ); M( "user u" )->join( "{$per}user_info x ON x.uid = u.id" )->where( "u.id = $uid" )->find(); |
ThinkPHP join() table()方法的使用,多表查询
原文:http://www.cnblogs.com/chinalorin/p/5855348.html