- //join()函数
- //看一下代码:
- $Demo = M('artist');
- $Demo->join('RIGHT JOIN think_work ON think_artist.id = think_work.artist_id' );
- //可以使用INNER JOIN 或者 LEFT JOIN 这里一定要注意表名的前缀!
- echo $Demo->getLastSql(); //打印一下SQL语句,查看一下
表名的前缀问题弄了半天!晕死!!!!!!!!
转载于:https://blog.51cto.com/rc699/1126549