How to do multi-condition filtering in PHP mall?
tianya
tianya 2018-03-06 13:46:15
0
2
1417

php How to do multi-condition filtering in the mall?

tianya
tianya

reply all(2)
郭骏博

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%

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template