echo_loser Posted January 25, 2012 Share Posted January 25, 2012 I am new to the whole PHP/MySQL thing and I had a question on database performance: After I connect to the database and do a SELECT statement on a table, what is the proper way to handle closing and/or freeing memory. Currently, in the book I am following, the ONLY thing that they do is a mysql_free_result() after they are done extracting the info from the table into variables. They say that although it is usually only used when expecting LARGE returns, it should be used consistently to mark the end of needing that result set. I was wondering is mysql_free_result() enough? Or is there something else I should be doing like closing the database with a die() or something? Quote Link to comment https://forums.phpfreaks.com/topic/255746-mysql_free_result/ Share on other sites More sharing options...
trq Posted January 25, 2012 Share Posted January 25, 2012 PHP has very good garbage collection mechanisms and in general you don't need to free any resources manually. Quote Link to comment https://forums.phpfreaks.com/topic/255746-mysql_free_result/#findComment-1311020 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.