PHP MYSQL实现登陆和模糊查询两大功能,mysql模糊查询
本文使用的软件版本如下:PHP版本 5.5.12;MYSQL版本 5.6.17;Apache 2.4.9 用的wampserver
一、PHPMYSQL实现登陆
一共含有两个文件:login.php和logincheck.php;表单代码:
后台处理代码:
Account数据库内容:
二、PHPMYSQL实现模糊查询
查询数据库(只给PHP的代码):
connect("localhost","sa", "123456");
if(mysqli_connect_errno()) {
printf("Failllllll:%s\n", mysqli_connect_error());
exit();
}
$mysqli->select_db("booklib");
$mysqli->query("SETNAMES utf8");
$rsbooks= $mysqli->query("select * from books where Name like'%$_POST[bookname]%'");
$row_rsbooks = $rsbooks-&g