Jump to content
Updating IPB tonight Read more... ×


This topic is now archived and is closed to further replies.


mysql_free_result() and unset()

Recommended Posts

I'm creating a CMS for a friend who plans to have an estimated 10,000 or more people register accounts and at a minimum maintain around 1,000 online at a time.

I plan to store all of the user information in MySQL along with some other information and I was curious as to whether I should use mysql_free_result($query); at the end of the footer file used on every page to clear up all of the queries or not.

I was also wondering, would performace be an issue if I didn't? How much does mysql_free_result effect load times? What's the difference between unset($query) and mysql_free_result($query)? And lastly, should I unset all of my variables created on the page as well as free up the queries?

If anyone can provide some insight, thanks 8)

Share this post

Link to post
Share on other sites
If you, as you say, put it at the end of the file, then it is unnecessary as it is automaticly done at the end of the script execution. I have actually seen an example where a script without used less memory than one with mysql_free_result(). I do not think it is necessary to call this function.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.