Hello,

I'm having an issue that I've never had before. The server that I am using is giving me this error:

Warning: Unknown: 8 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0

I realize it is probably good practice to use

mysql_free_result

after querying a database but I don't always do it.

I am using a pre-built shopping cart system and I don't want to locate every query to the db to free the results.

Can anyone tell me how I turn of this error reporting?

Thanks in advance.

    This sounds like some sort of custom code/error, not a built-in error message. (All results are automatically freed when the script completes, so you never have to free results, though it can help free up memory if dealing with many results or very large results.)

    You'll either have to find out where in your code that error is being detected and output, or else come up with something to find all mysql result resources and free them before that portion of the script gets executed.

      Mmmmm...

      I've never had this type of warning on any server I have ever used. I have not changed my approach to coding what so ever.

      Could it be a php.ini setting?

        Hmmm...looks like it could be related to the mysql.trace_mode setting.

        PS: This looks like something I'd definitely want turned off on a production host, though it might be useful in development.

          That's exactly what it is! You're a hero!

          Now...how do I disable it? 🙂

            Well, you have 3 basic choices:

            1. Change the php.ini file and restart the web server.

            2. If on Apache and it is configured to allow you to do so, you can change it in a .htacess file via the php_flag commad.

            3. You can change it within the script via ini_set():

              <?php
              ini_set('mysql.trace_mode', 0);
              
              Write a Reply...