MX Kollection Forum :: Warning: Unknown: 1 result set(s) not freed. Use mysql_free_

This thread was displayed: 0 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Phil A
03-19-2008 14:59:05 GMT +2

Hi all,

I currently changed the settings of php to show all errors and one of my websites now shows the following error:

Warning: Unknown: 1 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 upgraded my php and mysql and I still have this error and all nextensio lists do not work ie, show an empty form (even though there's data in the db) and the above error.

Some pages also show the above error and I've no idea how to correct this issue. 

Any help?

Back | Reply | Quote | Top
Fred at ExelWebs.com
03-19-2008 15:11:46 GMT +2

Hehehe.... Sorry for laughing but you asked for it...

This reminds me of the small dog that chased the bus every morning, till one day he managed to catch it and didn't know what to do with it...

Heads up mate, it happens to all of us.

Follow this link for information on the error and how to fix it.
http://www.w3schools.com/php/func_mysql_free_result.asp

You might also want to look at the php manual about error reporting and the different levels.
http://uk3.php.net/error_reporting

Reply | Quote | Top
Phil A
03-24-2008 18:14:20 GMT +2

That'll be easy Fred. 

What I don't understand is that all my queries have been freed and even though I get the error messages, there's no reference to any line numbers.

Btw, any ideas on why my nextensio lists suddenly don't wont to work?

Reply | Quote | Top
Fred at ExelWebs.com
03-24-2008 18:40:43 GMT +2

Ok what I think is happening is that your error checking is set to high with the result that you might get false error reports.

The way kollection / DW is handling sql connect queries is by using "mysql_pconnect" and at the end of the page "mysql_free_result" for every recordset.

Now if you have one instance on the page where the "mysql_free_result" is not there it will generate a php error and everything will stop.

I use a different approach instead of 

$exel = mysql_pconnect($hostname_exel, $username_exel, $password_exel) or trigger_error(mysql_error(),E_USER_ERROR);

as the connection string I use 

$exel = mysql_connect($hostname_exel, $username_exel, $password_exel) or die ('I cannot connect to the database because: ' . mysql_error());

and for good measure still have a "mysql_free_result" for each recordset at the end of the page.

"mysql_connect" automatically closes the connection after executing the query, "mysql_pconnect" relies on the "mysql_free_result" at the end of the page to explicitly close the connection.

By making sure every connection is closed after the query you have a more efficient use of your server. I for instance limit my hosting customers to max 50 mysql connections at any time. By using "mysql_connect" a connection is only "live" for however long it takes to get the results for the query and not till the php parser reaches the end of the page where it will be "freed" by the ,mysql_free_result" command.

I hope I am making sense...

Reply | Quote | Top
Phil A
03-25-2008 14:17:35 GMT +2

Great advice Fred.

Would use that and see if it helps.

Anyway thanks for ur time. U r a great help on these forums

Reply | Quote | Top
© Adobe Systems Romania. All rights reserved.