您现在的位置是:首页 > PHP技术PHP技术
Thinkphp3.1.3中组合where条件
2019-10-14【PHP技术】2263 人已围观
简介 一些复杂的项目中我们经常需要进行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:
很赞哦! ()
相关文章
随机图文
PHP优势可与Java应用程序集成
php发展势头迅猛,现在主流大网站都可以看到php的身影,php的另外一个优势是其调用已有java对象方法的能力。通过此项功能可将php集成...
Thinkphp5.1.30 Session使用笔记
原生PHP使用session过程<?php session_start(); session("username&q...
php获取图片的尺寸
php有很多的内置函数可以方便操作文件.如果我们的图片已经在服务器端,那么可以使用getimagesize()函数来获取图片大小.$im...
网站安全代码thinkphp3.1密码强度检测
/** *检查密码复杂度 */ publicfunctioncheckPassword($pwd){ if($pwd==null){...




微信收款码
支付宝收款码