scarhand Posted March 10, 2010 Share Posted March 10, 2010 Is this function required if you create a new connection right after another one? Or will the new connection simply replace the old one? Quote Link to comment Share on other sites More sharing options...
darkagn Posted March 10, 2010 Share Posted March 10, 2010 If you call mysql_connect with the same parameters and the new_link parameter set to false, then the connection is reused, that is another reference to the same connection is returned. The only time you need to call mysql_close() is when you need to free up some memory for some other memory-intensive task. There is no need to call it if you are just going to open another connection, all connections are freed once the script finishes its execution. Quote Link to comment 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.