Re: MySQL and SESSIONs

From: Date: Fri, 05 Oct 2007 22:17:16 +0000
Subject: Re: MySQL and SESSIONs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-262854@lists.php.net to get a copy of this message
Vo, Lance wrote:
What's good for multiple webservers? thanks
* DO NOT USE PERSISTANT CONNECTIONS * Minimise the amount of time you keep a database connection open during a request. Good logic/presentation separation helps a lot here. * Cache the crap out of everything - don't hit the DB unless you really need to. -Stut -- http://stut.net/ > -----Original Message----- > From: Stut [mailto:stuttle@gmail.com] > Sent: Friday, October 05, 2007 4:31 PM > To: Stefano Esposito > Cc: php-general@lists.php.net > Subject: Re: [PHP] MySQL and SESSIONs > > > Stefano Esposito wrote: >> is it somehow possible to store the connection reference obtained from mysql_connect() (note the absence of the "i") in a $_SESSION element? > > No. Why would you want to? You'd end up holding on to a database > connection even when nothing is using it. If you want to optimise things > look at http://php.net/mysql_pconnect but bear in mind that this starts > to suck if you scale up to multiple web servers. > > -Stut >

« previous php.general (#262854) next »