Rather weird warning (result)

Ask about a PHP problem here.
Post Reply
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Rather weird warning (result)

Post 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.
[syntax=php]return(mysql_result($total, 0) == '1') ? true : false;[/syntax]

I dunno why, the PHP version run on the host is 5.2.xx not sure what the last two numbers were :S
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Rather weird warning (result)

Post 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.
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Rather weird warning (result)

Post 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
Post Reply