Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mysql_free_result()

Status
Not open for further replies.

alphacooler

Programmer
Aug 29, 2005
73
US
Is it common practice to use this? I've heard some say it costs more memory invoking the function and others say it should always be done.
 
 
So adding mysql_free_result at the end of the script would be entirely pointless then right? Considering it will stop then regardless.

So instead I would put it right after I finish using the data from the result? Even on large result sets (what is "large" btw?) I don't see how it would help if it is being cleared at the end of the script regardless.

Thanks so very much, as you can tell i'm pretty new to PHP.
 
If your invocation of mysql_free_result() is the last line of your script, yes, it's redundant. If your script invokes the function right after it's done with the data, then it will do some good.

what is "large" btw?
Beats me -- how high is up?.

I know that if you have fetched multiple multigigabyte BLOBs from a database, you have probably fetched a large resultset. Beyond that, it's a term that is relative to your environment.


To be honest, I rarely use mysql_free_result(). As I can recall, the only time I use it is when I have multiple resultsets open at a time.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top