thinkphp多表查询
来源:互联网 发布:java jdk源码分析书籍 编辑:程序博客网 时间:2024/04/28 01:57
使用这个方法
$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语句,查看一下
以下方法还没用,做记录
1、table()
$list = $user->table('user_status stats, user_profile profile')->where('stats.id = profile.typeid')->field('stats.id as id, stats.display as display, profile.title as title,profile.content as content')->order('stats.id desc' )->select();
2、join()
$user = new Model('user');
$list = $user->join('RIGHT JOIN user_profile ON user_stats.id = user_profile.typeid' );
3、原生查询
$Model = new Model();
$sql = 'select a.id,a.title,b.content from think_test1 as a, think_test2 as b where a.id=b.id '.$map.' order by a.id '.$sort.' limit '.$p->firstRow.','.$p->listRows;
$voList = $Model->query($sql);
- Thinkphp 多表查询
- thinkphp 多表查询
- thinkphp多表查询
- thinkphp多表查询
- thinkphp多表查询语句
- ThinkPHP的多表查询
- ThinkPHP的多表查询
- thinkPHP多表联合查询
- thinkPHP多表联合查询
- thinkphp多表查询语句
- ThinkPHP关于多表查询
- thinkphp关联查询(多表查询)
- thinkphp关联查询(多表查询)
- thinkphp关联查询(多表查询)
- thinkphp多表查询及分页实现
- ThinkPHP多表联合查询实例代码
- 转载]ThinkPHP的多表查询
- thinkphp使用原生语句多表查询
- 一个ORACLE性能测试的小工具orabm
- 所有andorid权限集
- Axis2 WebService(配置、发布、调用)
- net-snmp的配置文件snmpd.conf配置说明
- mapreduce 多output
- thinkphp多表查询
- JBoss 7 里一个EJB依赖其他jar的几种方式
- Android中让View匀速旋转
- Extjs4中Ext下的一些常用方法
- 一步一步写算法 第三次 开始算法 单链表 简单单链表
- Eclipse设置代理来安装Maven插件
- Linux设备驱动剖析之SPI(三)
- VMware 安装 Fedora 10 后需要一些设置
- ecshop unserialize