Re: Warning: mysql_num_rows() expects parameter 1 to be resource....

Posted 06 November 2009 - 10:59 PM

// It should be $SQLstring first, $DBConnect second. Because they are wrong order
// This query is failing and thus returning "false" which is then causing the error
// in mysql
$QueryResult = @mysql_query($DBConnect, $SQLstring);
if (mysql_num_rows($QueryResult) > 0) {

As I already mention in the comments, you have your parameters in the mysql_query above it in the wrong order. The query is first, then the connection identifier. Since these are in the wrong order, your mysql_query is failing and thus returning false. This false is being passed to mysql_num_rows and causing the error.

Hope this helps!

Btw, this is a PHP question, so I will move it to the PHP forum. Thanks!