时时商务社区

标题: php mysql like 实现多关键词搜索的方法 [打印本页]

作者: qz234    时间: 2018-2-14 05:31

            或者叫,分词检索数据库
$res = mysql_query("select * from peter where id like '%中草药%' and '%6%'"); //这样写是报错的;
$res = mysql_query("select * from peter where id like '%中草药%' or '%6%'"); //而这样写是正确的;奇怪~

$res = mysql_query("select * from peter where id like '%中草药%' and id like '%6%'"); //这样写是正确的;
$res = mysql_query("select * from peter where id like '%中草药%' or id like '%6%'"); //这样写都是正确的;
以上就是小编为大家带来的php mysql like 实现多关键词搜索的方法全部内容了,希望大家多多支持脚本之家~
            
            
您可能感兴趣的文章:
  • PHP封装的字符串加密解密函数
  • php基于mcrypt_encrypt和mcrypt_decrypt实现字符串加密解密的方法
  • php通过PHPExcel导入Excel表格到MySQL数据库的简单实例
  • 浅谈php处理后端&接口访问超时的解决方法
  • PHP请求远程地址设置超时时间的解决方法
  • php 截取utf-8格式的字符串实例代码
  • php set_include_path函数设置 include_path 配置选项
  • PHP实现小偷程序实例
  • php 实现一个字符串加密解密的函数实例代码
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2