84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
php How to do multi-condition filtering in the mall?
Multiple conditions are generally related to and, not or
The conditions are all passed through the url, PHP obtains the condition value through get and reads it from the database
Solution for tp framework
$where['Conditional field 1|Conditional field 2'] = array('like', "%query keyword%");
M ('table')->where($where)->select();
Native code
select * from table name where field 1 like %query keyword% or field 2 like %query keyword%
Multiple conditions are generally related to and, not or
The conditions are all passed through the url, PHP obtains the condition value through get and reads it from the database
Solution for tp framework
$where['Conditional field 1|Conditional field 2'] = array('like', "%query keyword%");
M ('table')->where($where)->select();
Native code
select * from table name where field 1 like %query keyword% or field 2 like %query keyword%