您现在的位置是:首页 > PHP技术PHP技术
Thinkphp3.1.3中组合where条件
2019-10-14【PHP技术】2148 人已围观
简介 一些复杂的项目中我们经常需要进行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:
很赞哦! ()
相关文章
随机图文
Thinkphp5.1.30查询和查询分页代码
查询是非常频繁使用的功能。thinkphp5.1.30查询功能一般流程如下$keywords=Request::param('key...
Thinkphp3.1.3验证码字符居中显示
tp3中的验证码默认是按图片要求宽度加5个象素为起始的. 如果验证码设置非默认宽度就会造成字符不居中.居中解决办法修改\ThinkPHP...
mysql常见的多表查询语句
select*fromTable1,Table2whereTable1.id=1andTbale2.id-2(是某一相同字段)注意这样的查询...
Thinkphp3.1.3中的redirect详解
页面跳转是php编程中常用的方法,今天说说thinkphp3.1.3中的redirect.tp跳转有success和error这二个参数有...




微信收款码
支付宝收款码