Warning Error

I keep getting the following error on some pages

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a4577809/public_html/users/manager.php on line 14

But when I refresh(f5) the browser the error clears

Does anyone have any suggestions why i’m getting it

Perhaps the “First” time you reach the page a query is not processed resulting in the error. When “Refreshed” a variable (Maybe a session?) might be set allowing the query to be run successfully thus not getting the error.

On the first couple of line of the page I have a cookie set, maybe that is it.

If the query is expecting data from the cookie/session and it’s not set, then it will error.

If you KNOW this… Then you should “Trap” the error by checking for the existence of the cookie/session first, then, if the data is there, proceed with the query, otherwise, you could just skip it (the query that is), or present the user with some other message as appropriate.

I have now created a page to set the cookie then redirect to the main page. It seems to be OK now.

Thanks for your help. I’ll get used to PHP eventually Honest

Sponsor our Newsletter | Privacy Policy | Terms of Service