博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ThinkPHP3.2 多个where()使用问题【已解决】
阅读量:4230 次
发布时间:2019-05-26

本文共 436 字,大约阅读时间需要 1 分钟。

今天用TP3.2查询用户信息(条件很多啊!),悲剧来了!! 一直有一个条件不判断---也不会报错累啊

正题来了

$model = M("表明");

$model->where()->where()->......->select();

先查官方文档----官方指出  如果使用多个where()三个及三个以上的判断条件只能含有一个字符串条件  

其实判断条件多个(判断范围、<>=!、值....)解决方法  一类的可以放在同一个数组中

eg:

a:$data = array(

          '字段名' => 'values',

          。。。。。。。。。

);

b:$date['字段名'] = array('','');

$date['字段名'] = array('','');

c:$model->where(where()->where()->where().....)->select();

 

现在可以将结果dump()出来   看看是否符合条件~~~~~~~~~~~~

推荐官方手册地址(参考):

 

转载地址:http://wiiqi.baihongyu.com/

你可能感兴趣的文章
人工智能与机器学习学习笔记(二)
查看>>
Java I/O
查看>>
SQL Server 2005 T-SQL Recipes: A Problem-Solution Approach
查看>>
Core Python Programming
查看>>
Creating Database Web Applications with PHP and ASP
查看>>
ASP.NET 2.0 Demystified
查看>>
Pattern-Oriented Software Architecture, Volume 2, Patterns for Concurrent and Networked Objects
查看>>
Pattern-Oriented Software Architecture, Volume 1: A System of Patterns
查看>>
Database Programming with Visual Basic® .NET and ADO.NET: Tips, Tutorials, and Code
查看>>
ISO 9001: 2000 For Small Businesses
查看>>
Microsoft Visual Studio 2005 Unleashed
查看>>
Windows Server 2003 Security Infrastructures: Core Security Features
查看>>
Configuring ISA Server 2000
查看>>
Microsoft Money 2006 For Dummies
查看>>
Vision with Direction: A Systematic Introduction to Image Processing and Computer Vision
查看>>
Oracle Internals: Tips, Tricks, and Techniques for DBAs
查看>>
Programming Wcf Services
查看>>
AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Second Edition
查看>>
Pro Open Source Mail: Building an Enterprise Mail Solution
查看>>
Visual SourceSafe 2005 Software Configuration Management in Practice
查看>>