<?php
$link = mysqli_connect("localhost", "root", "", "test") or die(mysqli_error);
$name = $_POST["user"];
$pw = $_POST["password"];
if($name == "" || $pw =="")
{
echo "输入账号和密码";
}
else
{
$sql = "select * from user where logoin name == $name and pw = $pw ";
$qurey = mysqli_query($link,$sql);
$num = mysqli_num_rows($qurey);
if($num)
{
$row = mysqli_fetch_array($query); //将数据以索引方式储存在数组中
echo $row[0]." 欢迎!";
}
else
{
echo "<script>alert('用户名或密码不正确!');history.go(-1);</script>";
}
}
?>
这是代码求大神看看哪里错了
噜噜哒
Qyouu