Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Saturday, August 20, 2016

ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19

ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19


I keep on receiving an error message using mysql_num_rows(), can you help me figure out what went wrong on my code?

Here's my code:

Click Here';          exit();      }  }  ?>  

I've tried mysql_errno() as you advised.. and it echo 1146

and when I search for that error it says that

1146: Table 'kossu.nonexistenttable' doesn't exist  

But I don't know what it means... Please help.

Answer by KingCrunch for ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19


Probably mysql_query() failed. In this case it returns false. Use

href="http://php.net/mysql-error">mysql_error() to find out, what happens.

Answer by Sander Marechal for ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19


When there is an error, mysql_query() returnse false instead of a resource object. Check the return value of mysql_query() before you pass it to mysql_num_rows().

Answer by Ignacio Vazquez-Abrams for ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19


From the docs:

Return Values

For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.

So, you have an error. Use mysql_error() to find out what.

Answer by Arihant Nahata for ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19


mysql_query() failed. It returns false.To see the error use mysql_error()

Answer by whitehand for ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19


It's possible you've not selected the right database. I encountered such a problem before and the error was the database I selected.


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

Related Posts:

0 comments:

Post a Comment

Popular Posts

Fun Page

Powered by Blogger.