Re: MySQL Connection in Session ?

From: Date: Mon, 11 Jun 2007 18:34:35 +0000
Subject: Re: MySQL Connection in Session ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-256632@lists.php.net to get a copy of this message
PHP Mailing List wrote:
Can I maintain just one mysql connection resource to all my pages per user session. As far as I knows create connection is more expensive than executing queries ?
No, you can't store resources (of which mysql connections are one example) in sessions.
Any reference how to make efficient for connection resources ?
Making a connection to a MySQL database is a fairly expensive thing to do, but using persistant connections can make it a whole lot less problematic, but you may run into issues if you ever have multiple PHP boxes connecting to the same DB server depending on how your architecture works. -Stut

« previous php.general (#256632) next »