Jump to content

Recommended Posts

[!--quoteo(post=366862:date=Apr 20 2006, 11:39 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Apr 20 2006, 11:39 AM) [snapback]366862[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I never use them. It's closed automatically for you at the end of script execution, so why bother?
[/quote]

that's what I thought, so why even have them? I don't understand the purpose or usage...
Link to comment
https://forums.phpfreaks.com/topic/7947-free-result-or-close/#findComment-29016
Share on other sites

[!--quoteo(post=366869:date=Apr 20 2006, 04:56 PM:name=jcombs_31)--][div class=\'quotetop\']QUOTE(jcombs_31 @ Apr 20 2006, 04:56 PM) [snapback]366869[/snapback][/div][div class=\'quotemain\'][!--quotec--]
that's what I thought, so why even have them? I don't understand the purpose or usage...
[/quote]

i might be guessing - i actually have mysql_free_result but only cos it's the way i learnt and just stuck with it out of habit - but wouldn't it make all the difference with say, for example, a large script that deals with large tables on a high traffic site? surely freeing up a result would take the load of the server a little? all the manual really states is that its to be used if youre worried about memory when dealing with large results.

as for mysql_close - not a clue.
Link to comment
https://forums.phpfreaks.com/topic/7947-free-result-or-close/#findComment-29063
Share on other sites

The only case I could imagine is if you were dealing with more than one DBMS and you wanted to close one and open another. *shrug* I've just never dealt with anything that big (although I might soon at work... they want me to graph some test results with 10Hz data... 2 tests with 12000 records each compared on one graph!)
Link to comment
https://forums.phpfreaks.com/topic/7947-free-result-or-close/#findComment-29096
Share on other sites

[!--quoteo(post=366969:date=Apr 20 2006, 08:24 PM:name=SemiApocalyptic)--][div class=\'quotetop\']QUOTE(SemiApocalyptic @ Apr 20 2006, 08:24 PM) [snapback]366969[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I think you should be using mysql_close() when opening persistent connections with mysql_pconnect() as I don't [i]think[/i] they close themself...
[/quote]

according to the manual, it appears that mysql_close is used for non-persistent connections:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Note: mysql_close() will not close persistent links created by mysql_pconnect().
[/quote]and

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.
[/quote]

does make you wonder though, how much coding gets done that isn't that necessary...how many other functions are like this and not required, etc...
still.
Link to comment
https://forums.phpfreaks.com/topic/7947-free-result-or-close/#findComment-29160
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.