Jump to content

Is its important that we have to close MYSQL Connection


Recommended Posts

Is its important that we have to close MYSQL Connection in php after i use  a connection

i am using following functions


function GetConnection()
		return $COLAS_con;
function Connection_Close($COLAS_con)


i use this in my one of code


echo $now = date("Y/m/d", strtotime('+5 hour+30 minutes') );
include "DB_Connection.php";
$ColasObj=new DBConnection;


can i use close connection??is it important if so where??


Link to comment
Share on other sites

Because of php's garbage collection there is generally need need to worry about closing connections or cleaning up resources.


Did you type 2 "needs" by accident or was the 1st meant to be no? You have 2 needs there. Keep in mind if need or no, both can have the effect to drastically alter  the meaning of your sentence. I think you should clarify.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

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

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.