• I tried to display data from mysql database in a page using php. I am using Php Exec(1.7) plugin. I enclosed my php code within <phpcode> tag.
    I am successfully getting the data and rendered in the page. But the following warning also printed at the bottom of the page.

    Warning: mysql_real_escape_string(): 10 is not a valid MySQL-Link resource in C:\xampplite\htdocs\wordpress\wp-includes\wp-db.php on line 478

    Warning: mysql_real_escape_string(): 10 is not a valid MySQL-Link resource in C:\xampplite\htdocs\wordpress\wp-includes\wp-db.php on line 478

    Warning: mysql_error(): 10 is not a valid MySQL-Link resource in C:\xampplite\htdocs\wordpress\wp-includes\wp-db.php on line 713

    What could be the problem and how to suppress it? Please help

Viewing 2 replies - 1 through 2 (of 2 total)
  • I assume that you are using something like the wamp server and that this is not occuring while your site is viewed live from the web??

    If you are using a package like the wamp server there is a option to turn off error reporting in it. Look at its control and click what you think would be the correct choice. If that does not work unclick it and then try another.

    If not you will need to look at your pnp.ini file and choose the line to suppress the error reporting.

    You may have more than one php.ini file so make sure you take one of them and keep it clean so that if you make a mistake and inadvertently make php not work at all you have a fresh file to use as a replacement.

    All of the php.ini files can be edited but I believe only one of them is used when php is running.

    Hope this helps.

    az

    One more thing:

    If I got an error message like yours I would want to look closely at the call to the db as you may be able to fix it at that level first.

    I might look at the variable names and make sure that they are exactly the same throughout.

    but…without seeing your code I cannot say for sure.

    az

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘how to suppress mysql warning’ is closed to new replies.