php搜索站内数据库,请教

WBOY
Release: 2016-06-02 11:32:42
Original
1205 people have browsed it

php数据库搜索

我想做一个搜索站内数据库的搜索框,
写好了之后打开空空如也,连搜索框和按钮都没有
请问是咋回事
代码如下




搜索

include("conn.php");
$db=new mysql('localhost','root','','sjzl','utf8');
if($_GET[key]){
$sql="select * from message where showname like '%$_GET[key]'";
$result=mysql_query($sql);
while($arr= mysql_fetch_array($result)){
$arr[showname]=preg_replace("/($_GET[key])/i","\1",$arr[showname]);
echo $arr[showname];
}
echo $arr[showname];
}
?>

关键字:


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template