您现在的位置是:首页 > PHP技术PHP技术
Thinkphp3.1.3中组合where条件
2019-10-14【PHP技术】2206 人已围观
简介 一些复杂的项目中我们经常需要进行where条件的组合.二组where组合语法如下$where[‘name’]...
一些复杂的项目中我们经常需要进行where条件的组合. 二组where组合语法如下
$where[‘name’] = array(‘like’, ‘%thinkphp%’); $where[‘title’] = array(‘like’,’%thinkphp%’); $where[‘_logic’] = ‘or’; $map[‘_complex’] = $where; //申明map与where组合 _complex $map[‘id’] = array(‘gt’,1);
最终生成sql
( (namelike’%thinkphp%’)OR(titlelike’%thinkphp%’) ) and id>1
关注宁波网站建设博客,更多精彩分享,敬请期待!
Tags:
很赞哦! ()
相关文章
随机图文
Mysql进阶之in详解
MySQL IN 语法 IN 运算符用于 WHERE 表达式中,以列表项的形式支持多个选择,语法如下: WHERE column IN ...
网站安全代码thinkphp3.1密码强度检测
/** *检查密码复杂度 */ publicfunctioncheckPassword($pwd){ if($pwd==null){...
下拉菜单select友情链接跳转代码
下拉菜单select友情链接自动跳转做法,一般是用js 或者 jquery来做到. 这是网站开发当中前端居必会及常用的技巧.可惜殷雯工作室...
thinkphp imagettftext(): Could not find/open font验证码无法显示报错
thinkphp imagettftext(): Could not find/open font tp5.1验证码无法显示.打开debu...




微信收款码
支付宝收款码