是否需要准备好的语句才能获取值?如果是这样,我找不到参考。我正在使用预准备语句写入MYSQL。这是我的工作代码。感谢
//Check that Email matches Password, then get First Name and start session
if ($getFname = mysqli_fetch_assoc(mysqli_query($con, "SELECT userFname FROM users WHERE userEmail = '$userEmail' and userPassword = '$userPassword'"))) {
//Grab first name
$data = $getFname['userFname'];
//assign unique session ID
$_SESSION[Email]=$userEmail;
//Remember first name
$_SESSION[Fname] = $data;
//go to dashboard page
header ("location: dashboard.php");}
}else{
$error2="Email and Password do not match, please try again.";
}