note 79710 deleted from function.mysql-connect by nlopess

From: Date: Wed, 02 Jan 2008 16:05:39 +0000
Subject: note 79710 deleted from function.mysql-connect by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134660@lists.php.net to get a copy of this message
Note Submitter: gjorgjioski at gmail dot com ---- Many times many people will get the warning mysql_connect(): Too many connections I'm one of them. I know what is exactly my problem: too many people at the same moment, and not enough recourses to increase max_connections at the moment. However I did write the following script, just to keep people waiting on connection being available <code> $DB_conn=0; while (!$DB_conn){ $DB_conn = @mysql_connect($host, $user, $pass); if (!$DB_conn){ sleep(2); } } </code> However, it seems to me that implementation of mysql_connect after warning dies. If I'm right, this is really good to be noted here.

« previous php.notes (#134660) next »