Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wmo/public_html/frontend.php on line 17
Anyone know what this means - the site worked find until i had to move hosting provider adn now i get this?
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wmo/public_html/frontend.php on line 17
It means it doesn't have a result resource to use.NightmareXX said:It would seem that your host is running a different version of PHP/MySQL then your previous host.
Most likely reasons are a changed MySQL configuration - check hostnames, usernames, passwords and so onphp.net said:Parameters
result
The result resource that is being evaluated. This result comes from a call to mysql_query().
Isn't that almost the same as a different version? I installed PHP5 ages ago and it didn't come with any of the MySQL functions although that was a PHP thing.Beansprout said:It means it doesn't have a result resource to use.
Moredhel said:It means some part of your query failed. Check mysql_query hasn't returned false and check the values of mysql_error() and mysql_errno()
Although it's a possibility, it most likely has nothing to do with the mysql / php versions involved.
$result = mysql_query($sql,$conn) or die('<!--'.mysql_error().' -->';);
Hmm, I wouldn't ever leave the error message where the end user could see it, I tend to log them and throw a "nice" error message for the end user. That way no possible security info could get out. Of course I'm usually using my Exception class, which does it all automagically for me.Beansprout said:That's what I do quite a lot (well, similar) - throw MySQL errors between comment tags so users don't see them but you still get the debug info.Code:$result = mysql_query($sql,$conn) or die('<!--'.mysql_error().' -->';);
vBulletin does it so it must surely Be The Way. But then again vB also e-mails the administrator every time it trips over.....
Ditto.. no errors that contain privy info such as DB login details (once the system is into 'live' environment,) should ever be produced to anywhere but a controlled log/area. Sensitive error messages, such as mysql_error() can and does produce make it so much easier for malicious attackers to gain access to areas they shouldn't.Moredhel said:Hmm, I wouldn't ever leave the error message where the end user could see it, I tend to log them and throw a "nice" error message for the end user. That way no possible security info could get out. Of course I'm usually using my Exception class, which does it all automagically for me.![]()