0

Unexpected parameter PHP

I'm trying to get the numbers of rows from a column in php but it is giving me this error Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in C:\xampp\htdocs\myFirstPHP\index.php on line 19 can someone help me out please i'm stuck https://code.sololearn.com/w0sUu5ecOAmV/#php

26th Jul 2020, 4:23 AM
Prosper Emebo
Prosper Emebo - avatar
2 ответов
+ 1
Check whether the query succeeded before passing the query result to `mysqli_num_rows`. When a query fails, `mysqli_query` returns a boolean (false). I suppose this is the cause of the error, as the error message said, "bool given".
26th Jul 2020, 4:57 AM
Ipang
+ 1
Thanks for the help, found the bug i made a typo in the spelling of my table
27th Jul 2020, 2:00 AM
Prosper Emebo
Prosper Emebo - avatar