最方便在线网站开发,网站备案时网站没有内容可以,社交网站开发客户,哪个建站平台较好1、条件都是int类型#xff1a; $User-where(type1 AND status1)-select(); 2、条件包含字符串类型#xff1a; 使用3.1以上版本的话#xff0c;使用字符串条件的时候#xff0c;建议配合预处理机制#xff0c;确保更加安全#xff0c; $Model-where(i…1、条件都是int类型 $User-where(type1 AND status1)-select(); 2、条件包含字符串类型 使用3.1以上版本的话使用字符串条件的时候建议配合预处理机制确保更加安全 $Model-where(id%d and username%s and xx%f,$id,$username,$xx)-select(); 或者 $Model-where(id%d and username%s and xx%f,array($id,$username,$xx))-select(); 3、数组条件 $User M(User); // 实例化User对象
$map[name] thinkphp;
$map[status] 1;
// 把查询条件传入查询方法
$User-where($map)-select(); 4、表达式查询比如大于小于不等于等 $map[a] array(gt,1);
$where[b] 1;
$Model-where($map)-where($where)-where(status1)-select(); 转载于:https://www.cnblogs.com/xuzhengzong/p/7168772.html