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%