0

I've been trying to look deep into the script, but I still can't find the problem. here's the script

global $con;
$a= "SELECT id_list FROM list ORDER BY id_list";
$b = mysqli_query($con, $a);
$c=  mysqli_fetch_assoc($b);        
    if(mysqli_num_rows($c)==0){
        echo'0';
    }else{
        echo '1';
    }       

the error that appear is

mysqli_num_rows() expects parameter 1 to be mysqli_result, array given

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

4

You have to use mysqli_result onject as a parameter to mysqli_num_rows() so try:

mysqli_num_rows($b)

read manual here link

Dharman
  • 30,962
  • 25
  • 85
  • 135
gaurav
  • 1,281
  • 1
  • 13
  • 25