4 回答
TA贡献3593条经验 获得超0个赞
TA贡献134条经验 获得超63个赞
说不好哪点错了,不如你这样试下
<?php
$username=$_POST['username'];
$password=$_POST['password'];
$mysqli=new mysqli('localhost','root','root','test');
if($mysqli->errno){
die('Connect Error:'.$mysqli->error);
}else{
$mysqli->set_charset('UTF8');
}
$sql="select * from imooc_test where username='{$username}' and password='{$password}'";
$result = mysqli_query($mysqli,$sql);
//var_dump($result);die;
$row = mysqli_fetch_array($result);
var_dump($row);
TA贡献58条经验 获得超18个赞
$sql
=
"select * from imooc_admin where username='{$username}' and password='{$password}'"
;
改成
$sql
=
"select * from imooc_admin where username='".$username."' and password='".$password."'"
;
试试
- 4 回答
- 0 关注
- 2347 浏览
添加回答
举报