如题.我想问一下,PHP怎样做搜索功能.越简单越好.求大神
我自己写就是这样:
第一页:
<form action="search.php" method="POST" name="form1">
<input type="text" name="search">
<input type="submit" name="sub1" value="搜索">
</form>
---------------------------------------------
Search.php页:
<li>
<?php
$search=$_POST['search'];
$sql=mysql_query("SELECT * FROM job WHERE address like '$search'");
$search1=mysql_fetch_array('$sql');
echo $search1;
?>
</li>
--------------------------------------------
求大神指点.
是不是两个页面都要绑定同一个数据表?
------解决方案--------------------
$sql=mysql_query("SELECT * FROM job WHERE address like '%$search%'");
$search1=mysql_fetch_array($sql);
------解决方案--------------------
行 的