PHP突然显示了这个错误
这是我的登录代码:PHP突然显示了这个错误,php,phpmyadmin,Php,Phpmyadmin,这是我的登录代码: <?php $con = mysqli_connect("localhost", "id2815222_b1gbrother", "orwell", "id2815222_database"); $studentno = $_POST["studentno"]; $password = $_POST["password"]; $statement = mysqli_prepare($con, "SELECT * FROM bigbrother WHERE stude
<?php
$con = mysqli_connect("localhost", "id2815222_b1gbrother", "orwell", "id2815222_database");
$studentno = $_POST["studentno"];
$password = $_POST["password"];
$statement = mysqli_prepare($con, "SELECT * FROM bigbrother WHERE studentno = ? AND password = ?");
mysqli_stmt_bind_param($statement, "is", $studentno, $password);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $userID, $studentno, $firstname, $middlename, $lastname, $date, $password, $number);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
$response["success"] = true;
}
echo json_encode($response);
昨晚运行得很好,但今天下午显示了以下错误:
警告:mysqli_stmt_execute():第9行/storage/ssd3/222/2815222/public_html/login2.php中的数据(mysqlnd_wireprotocol.c:1130)过早结束
警告:mysqli_stmt_execute():第9行/storage/ssd3/222/2815222/public_html/login2.php中的RSET_头数据包比预期短4字节
警告:mysqli_stmt_execute():在第9行的/storage/ssd3/222/2815222/public_html/login2.php中读取结果集的头时出错
{“成功”:错误}
我的数据库有:用户id
,名字
,中间名
,姓氏
,日期
,密码
,编号
列。谢谢您能检查一下吗?我已经检查过了,但遗憾的是我找不到答案。永远不要以明文形式存储密码!这是最大的禁忌之一。只存储密码哈希!使用PHP的和。如果您运行的PHP版本低于5.5(我真的希望您不是),您可以使用来获得相同的功能。您的mysqli\u stmt\u bind\u结果
在id之后和名字之前有一个$studentno。在这种情况下,我总是列出我正在选择的列,因此与其select*
-selectuserid,firstName…
您是否以纯文本形式存储密码?我认为你应该只选择由学生不为什么你添加密码也在你的where子句?你能检查这个吗?我已经检查过了,但遗憾的是我找不到答案。永远不要以明文形式存储密码!这是最大的禁忌之一。只存储密码哈希!使用PHP的和。如果您运行的PHP版本低于5.5(我真的希望您不是),您可以使用来获得相同的功能。您的mysqli\u stmt\u bind\u结果
在id之后和名字之前有一个$studentno。在这种情况下,我总是列出我正在选择的列,因此与其select*
-selectuserid,firstName…
您是否以纯文本形式存储密码?我认为你应该只选择由学生否为什么你添加密码也在你的where子句?