View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 09:48 AM
Willem Bogaerts
 
Posts: n/a
Default Re: Better to login/out for each query?

> Is it better to log in or out for each query or log in and stay logged in
> for all queries?


Under windows: definitely not! There is an issue that ports remain open
for a couple of minutes before they can be reused again. So you can run
out of free ports...

In general: I never even tried it, but I suspect it slows things down a
bit. On the other hand, logging in into a mysql database is not that slow.

> It would be easier for me to log in and out for each query but I'm worried
> that this might cause excessive overhead in the future.


Why? It is not that difficult to keep connection or connection wrapping
objects in a variable. And as a programmer you are responsible to
dispose of any resources you open. Even if PHP is a bit forgiving in
this respect.

Best regards.
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Reply With Quote