MyBB Community Forums

Full Version: When to use $db->free_result?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
was wondering when should we use $db->free_result? 
thanks  Blush
I'd say it is best practice to always use it, but I personally don't. Read the following:
https://stackoverflow.com/a/2502228
(2020-06-06, 08:19 AM)Omar G. Wrote: [ -> ]I'd say it is best practice to always use it, but I personally don't. Read the following:
https://stackoverflow.com/a/2502228

thx!
free_result() is like testing... you use it when you're unsure of your code. You can't be a guru if you test or if you free resources Big Grin
Seriously, I never use free_result(), PHP & MySQL do it for me (cross fingers), I know I have to use it to follow best practices. Queries in plugins are rarely so heavy that they need to be freed, but if everybodies think that, troubles may arrive.
I'll try use it in next plugins / evolutions.

P.S.: I'm still not going do tests on my developments Big Grin