I am trying to query a database to check if an email is already registered, following submission of user details.
However, I get a "Strict standards: Only variables should be passed by reference" error with the following code (excerpt):
} else if (isset($_POST['srSubmit']) && $_POST['srEmail']) {
//check if email already taken
if ($stmtreg = $mysqli->prepare("SELECT user_email FROM users WHERE user_email = ?")) {
$stmtreg->bind_param("s", strtolower($_POST['srEmail']));
$stmtreg->execute();
$stmtreg->store_result();
$num_rows = $stmtreg->num_rows();
$stmtreg->bind_result($email);
$stmtreg->fetch();
$stmtreg->close();
}
I have two questions: i) why does the script still work, even with this error? an ii) what is causing it and how do I fix it?
Thanks