Php + ajax implements google search function 2 [original]. Original Works Original site: www.111cn.cn author: Noodle love rabbit QQ: 271728967 note: Reprint please note that the original www.111cn.cn now let's talk about the post. php file, post. php file //
Original works
Original site: www.111cn.cn
Author: Noodle love rabbit QQ: 271728967
Note: Reprint please explain the original out of http://www.111cn.cn
//
Now let's talk about the post. php file. The post. php file is very simple. it may not be used in php many times, as long as it can be completed at the server foot. {Personal opinion}
Header ("Content-type: text/html; charset = gb2312"); set the document encoding.
$ Key = isset ($ _ POST ['key'])? $ _ POST ['key']: '';
$ SQL = "select title from test where title like '% $ key %' order by title desc ";
$ Result = mysql_query ($ SQL) or die (mysql_error ());
Echo"
";
While ($ rs = mysql_fetch_array ($ result )){
Echo"
". $ Rs ['title']."";
}
Echo"
";
Php + ajax implement google search function 2 [original].
Http://www.111cn.cn/test/test.html address:
Http://www.bkjia.com/PHPjc/631913.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631913.htmlTechArticle// original works site Original: www.111cn.cn author: love rabbit noodles QQ: 271728967 note: Reprint please note that the original out of http://www.111cn.cn // Now let's talk about the post. php file, post. php file...