Jump to content

Would the connection remain open in this case?


adrianTNT

Recommended Posts

Ok.

 

What if I run two queries one after another with the same name and I only clear results ONCE after this? Will it be the same as I clear result after each query?

 

recordset1 = "some query";
recordset1 = "some other query";
free_result recordset1;

 

will it be the same (in terms of memory usage) with this?

 

recordset1 = "some query";
free_result recordset1
recordset1 = "some other query";
free_result recordset1;

why are you using p connect please?

 

was going to say, why use dream weaver then if false d to use p connect?

 

 

in essence your worrying about nothing are you?

 

i got some web sites, with 100 of query's one aft her another no problem.

 

Sorry i didn't see you said pconnect :) Yes when you are using pconnect your connection remains open for future use. Which means that the connection will only be made once. So every new visitor will use the already existing open connection; You do not have to change your code or anything. pconnect will automatically checks if a connection already exists. If it exists, then it will use the already existing instead of creating a new connection. Persistent connections are used for performance but they may be a security problem.

Grr... I just realised that I was confusing the mysql_free_result that I have at the end of my scripts with mysql_close.

 

It is mysql_free_result that is not always reached because it exits before it. So this will not cause too many connections problem, it will just use more ... RAM ? Or what memory?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.