更新时间:2022-11-29 22:54:04
你可以试试这个:(即使它不起作用,它至少会显示你面临的错误)
You could try this: (Even if it doesn't work, it will atleast display the error you are facing)
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
error_reporting(E_ALL);
$con = new mysqli("localhost","username","password","Villa1234");
$sql = "SELECT * FROM Prospects WHERE email = ?";
$stmt = $con->prepare($sql);
$stmt->bid_param("s", $loginEmail);
$stmt->execute();
$result = $stmt->bind_result();
if($result->num_rows==1){
while($firstRow=$result->fetch_assoc()){
$status = $firstRow['status'];
$access = $firstRow['access'];
$pid = $firstRow['prospect_ID'];
if ($status == "Pending") {
$loginResult = "pending";
}
else if ($access == "locked") {
$loginResult = "locked";
}
else {
$storedPassword = $firstRow['password'];
if ($storedPassword === $password) {
$loginResult = "success";
$firstName = $firstRow['firstname'];
$_SESSION['loginEmail'] = $loginEmail;
} else {
$loginResult = "incorrect password";
}
}
}
}
else if ($rows == 0) {
$loginResult = "email not registered";
}
?>