请...我一直试图捕获搜索结果,这样如果搜索与数据库中的任何项目都不匹配,它应该说"没有搜索结果"因为我的代码显示错误,例如" mysql_fetch_array期望参数1成功" ..请,我想陷阱它,也希望我的脚本能够搜索我的数据库上的不同表...谢谢..下面是我的剧本:
mysql_connect("Localhost","kc","kc");
mysql_select_db("search");
$term=$_GET['term'];
$words=explode(" ",$term);
foreach ($words as $words)
{
$queries[]="select * from maxwell where Address LIKE '%" .
mysql_real_escape_string($words) . "%' LIMIT 0,$_GET[results]";
}
$query=implode(' OR ' ,$queries);
$results=mysql_query($query);
while($row = mysql_fetch_array($results))
{
echo $row['sn']."<br/>";
echo $row['Name']."<br/>";
echo $row['Password'];
}
?>