-
- $keyword="1 2 3";
- echo $sql=search($keyword,"enter_gongyin_pic","a+b+c"); //函数生成,没有LIMIT,没有ORDER BY
-
复制代码
生成sql语句:
-
- SELECT * FROM `enter_gongyin_pic` WHERE `a` LIKE '%1%' OR `a` LIKE '%2%' OR `a` LIKE '%3%' OR `b` LIKE '%1%' OR `b` LIKE '%2%' OR `b` LIKE '%3%' OR `c` LIKE '%1%' OR `c` LIKE '%2%' OR `c` LIKE '%3%'
复制代码
$keyword由POST或者GET获得,按空格分开,可以多字段去查找.
多关键字、多字段生成sql查询语句的函数:
|