Я получаю следующую ошибку:
Warning: mysqli_stmt_bind_result(): Number of bind variables doesn't match number of fields in prepared statement in line 48
Ниже приведена строка 48
mysqli_stmt_bind_result($stmt, $user_email, $user_pass);
Ниже приведена большая часть кода
// Using mysql_real_escape_string to ensure that the statements are legal SQL statements that can be stored $email = mysqli_real_escape_string($con, $_POST['email']); $password = mysqli_real_escape_string($con, $_POST['password']); /* Using Prepared statement to prevent SQL Injection */ // Create a perepared statement if($stmt = mysqli_prepare($con, "SELECT * from admins WHERE user_email=? AND user_pass=?")) { // Bind the paramaters mysqli_stmt_bind_param($stmt, "ss", $email, $password); // Execute the query mysqli_stmt_execute($stmt); /* Usually we would bind the result to be able to retrieve their given value However, in this case we are not interested in retrieving values from the database */ /* fetch value */ mysqli_stmt_fetch($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $user_email, $user_pass); echo $user_email;
Соединение правильно установлено и даже без условия, заданного в запросе myqsli_prepare, я все равно получаю ту же ошибку.
Любая помощь будет принята с благодарностью.