search

Home  >  Q&A  >  body text

How to do multi-condition filtering in PHP mall?

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

tianyatianya2453 days ago1418

reply all(2)I'll reply

  • 郭骏博

    郭骏博2018-03-20 17:51:16

    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

    reply
    0
  • 炎

    2018-03-06 16:38:19

    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%

    reply
    1
  • Cancelreply