一个条件的时候,可以直接运用以下方法:

$map['miaoshu'] =array('like','%'.$sp.'%');
$result=M('shangpin')->where($map)->select();

多个查询条件的时候,

$map['spname | miaoshu'] =array('like','%'.$sp.'%');
$result=M('shangpin')->where($map)->select();

标签: php, thinkphp

已有 2 条评论

  1. 陈

    $sp是什么,随便起的吗

添加新评论