Skip to main content
Inspiring
November 22, 2009
Question

My sql error help.

  • November 22, 2009
  • 1 reply
  • 293 views

Hi,

I use PHP MySQL

When using dreamweaver I have never had this problem. But after creating my recordsets I get this error in the browser. But the strangest part is that it only does this for some recordsets. Please help. I have noticed that it only does this to the recordsets that are using this code:

$totalRows_*** = mysql_num_rows($all_***);

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ***/thebest.php on line 58

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ***/thebest.php on line 79

Thanks in advance for all help!

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
November 23, 2009

cwhazzoo wrote:

I have noticed that it only does this to the recordsets that are using this code:

$totalRows_*** = mysql_num_rows($all_***);

Are the asterisks just your way of indicating different values, or are they part of the code? If the latter, an asterisk is invalid in a PHP variable.

I'm assuming that the asterisks just indicate different values. In that case, your SQL query has failed, which is why PHP is telling you that the supplied argument is not a valid MySQL result resource. Is MySQL giving you any error message?