Home  >  Article  >  Backend Development  >  关于PHP的搜索功能.越简单越好.求大神,该如何解决

关于PHP的搜索功能.越简单越好.求大神,该如何解决

WBOY
WBOYOriginal
2016-06-13 13:31:46746browse

关于PHP的搜索功能.越简单越好.求大神
如题.我想问一下,PHP怎样做搜索功能.越简单越好.求大神
我自己写就是这样:
第一页:





---------------------------------------------
Search.php页:

  • $search=$_POST['search'];
    $sql=mysql_query("SELECT * FROM job WHERE address like '$search'");
    $search1=mysql_fetch_array('$sql');
    echo $search1;
     ?>

  • --------------------------------------------
    求大神指点.
    是不是两个页面都要绑定同一个数据表?

    ------解决方案--------------------
    $sql=mysql_query("SELECT * FROM job WHERE address like '%$search%'");
    $search1=mysql_fetch_array($sql);

    ------解决方案--------------------
    行 的
    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn