Page 1 of 1

Rather weird warning (result)

Posted: Wed Oct 19, 2011 9:50 pm
by EcazS
I'm trying to insert a "list" in my table and it works perfectly locally but when I uploaded it to my one of my hosts it just broke.
I get this error,
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/ecazs/public_html/public_list/core/func/data.func.php on line 24
And this is line 24.
return(mysql_result($total, 0) == '1') ? true : false;
I dunno why, the PHP version run on the host is 5.2.xx not sure what the last two numbers were :S

Re: Rather weird warning (result)

Posted: Thu Oct 20, 2011 7:15 pm
by jacek
Add a mysql_error() after the query above. This means the query is failing which causes mysql_query() to return false (a boolean) and not a result. If it's after your host did something, most likely is that they changed your MySQL password and did not tell you.

Re: Rather weird warning (result)

Posted: Thu Oct 20, 2011 7:24 pm
by EcazS
It told me "No database selected" which freaked me out a little 'cause I had a database selected in the code the issue however was that I had forgotten to add my MySQL user to that database. Since I have "unlimited" databases and MySQL users I have to add users to a specified database to be able to use it. Which can be a good thing but it's also rather stupid...

:S