tnfh.net
当前位置:首页 >> thinkphp3.2 whErE in >>

thinkphp3.2 whErE in

$user=M('user');$rs=$user->where("user='admin'")->limit ( 1 )->select ();

楼主 应该是ID=array(1,2,3,4...) where id=ID就行了 在Thinkphp中多个都是用数组表示的。

$model = M("b");$subQuery = $model->field('id')->where($map)->buildSql(); $modle2 = M("a");$List = $model2->where('id not in '.$subQuery)->select(); 这是thinkphp3.0的新特性貌似

对前台传来的商品id数组在表中进行查询 //$goods = array(11,10,7); $where['goods_id']=array("in",$goods); $where['user_id'] = $_SESSION['uid']; $res = D("cart")->where($where)->select(); 复制代码 得到sql语句如下 "SELECT * FROM `ca...

以一个 user 表和 jifen 表联查为例,, 第一种方式: $data = M('user as a')->join('jifen as b on b.id = a.id')->where('a.id = 1')->select(); 第二种: $data = M()->table('user as a')->join('jifen as b on b.id = a.id')->where(' a.id...

你的条件用数组装起来就可以完成,例如: $condition['name']=$_GET['name'];$condition['id']=$_GET['id'];$condition['age']=$_GET['age'];$result=$info->field($in)->where($condition)->limit(300)->select();

$userForm=M('user'); //实例化数据表 $where['name']=array('like','%查询条件%');//写查询条件 $userForm->where($where)->select();

http://www.jb100.net/html/content-28-246-1.html

thinkphp3.2 有一个调试模式下专用的调试配置项,文件位置在: /ThinkPHP/Conf/debug.php,里面有一个配置选项 'URL_CASE_INSENSITIVE' => false //URL默认区分大小写,当 APP_DEBUG 开启时,该配置文件中的配置选项生效,关闭时则无效; 当 APP...

直接上代码 [php] view plain copy $product_info = M('product_info as info'); [php] view plain copy $productinfo = $product_info->join('left join c_price_comment as comment on info.sku=comment.sku')->where($where)->order('info.cr...

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com