L
L
Lech 2282018-04-19 11:10:44
PHP
Lech 228, 2018-04-19 11:10:44

I've been sitting on this for 2 days and it gives me an error mysqli_num_rows expects parameter 1 to be mysqli_result null given. I am signing in to the site. How to fix?

<?php 
$connection = new mysqli("localhost","root","","web") or exit("False"); 
  
if(isset($_POST['check'])){ 
$login = $_POST['login']; 
$password = $_POST['password']; 
 
$query = mysqli_query($connection,"SELECT * FROM `usersreal` WHERE `login` = '$login' AND `password` = '$password'");} 
 
if(mysqli_num_rows($query) == 0){ 
 mysqli_fetch_assoc($query); 
 
 echo"Введите верные данные"; 
} 
else{ 
 echo"Вы успешно вошли"; 
} 
?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question