Skip to main content
Inspiring
September 10, 2012
Answered

Warning: at bottom of php page

  • September 10, 2012
  • 1 reply
  • 517 views

Hello

I have a php password protected page that is showing the following message at the bottom of the page. What does it mean? How do I get rid of it?

Warning: mysql_free_result() expects parameter 1 to be resource, null given in /home/myusername/public_html/newsletter.php on line 123

When I look at the code at line 123 on that page is reads mysql_free_result($rsemailsetup);

Thanks

This topic has been closed for replies.
Correct answer David_Powers

The error message means that your database query failed to produce a valid result. The problem doesn't lie at the foot of the page, but in the database query for rsemailsetup.

One way you could suppress that error message is by wrapping line 123 in a conditional statement like this:

if (is_resource($rsemailsetup)) {

    mysql_free_result($rsemailsetup);

}

However, that doesn't solve the problem with $rsemailsetup not being a valid database result.

1 reply

David_Powers
David_PowersCorrect answer
Inspiring
September 11, 2012

The error message means that your database query failed to produce a valid result. The problem doesn't lie at the foot of the page, but in the database query for rsemailsetup.

One way you could suppress that error message is by wrapping line 123 in a conditional statement like this:

if (is_resource($rsemailsetup)) {

    mysql_free_result($rsemailsetup);

}

However, that doesn't solve the problem with $rsemailsetup not being a valid database result.

Gale12Author
Inspiring
September 12, 2012

Thanks for your input. I will keep trying. At least I can get rid of the text while I figure it out.