PHP MYSQLI Call to a member function bind_param() -
this question has answer here:
- reference - error mean in php? 30 answers
my code
$query1 = "select `user_id` `it_user` (user_email_address = ? , user_mobile_number_verified = null)"; $stmt1 = $mysqli->prepare($query1); $stmt1->bind_param("s",$email); $stmt1->execute(); if ($stmt1->affected_rows == 1) { //set registration flag 1 stating users mobile number verified echo '<meta http-equiv="refresh" content="0; url=\'../signin/\'"/>'; } else { $registration_flag = 2; //redirect user error page //echo '<meta http-equiv="refresh" content="0; url=\'../error/\'"/>'; }
i getting error ::
call member function bind_param() on non-object in ***** on line 62
where email variable working corrrect , query.
use null safe operator , write code below:-
$mobile = null; // note: no quotes - using php null $query1 = "select `user_id` `it_user` user_email_address = ? , user_mobile_number_verified <=> ?"; $stmt1 = $mysqli->prepare($query1); $stmt1->bind_param("s",$email); $stmt1->bind_param($mobile); $stmt1->execute();
hope :-)
Comments
Post a Comment