My hosting provider only allows for 50 simultanious connections to a sql database at once and they said they wont change it. Does anyone know of a way that some sort of a script or something would check to make sure that the server can accept there connection and if not would hold them in a queue until a "spot" is avaiable to them to connect. This problem would be major for a vbulletin forum. Or if anyone has any other sugesstions that would be greatly appreciated.
Thanks.
PPC
mysql maximum connections help
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
You might be able to do something like this:
This would try to connect to the database, and if it fails it would try again, until its available, it might make your code slower, but its something worth a shot for now
Code: Select all
function databaseconnect(){
// Connection Stuff
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Data passata
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// sempre modificato
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
error_reporting(E_ALL);
$host = 'localhost';
$dbuser = '';
$dbpass = '';
$dbname = '';
$table = '';
$db_connect = @mysql_connect($host,$dbuser,$dbpass);
$db = mysql_select_db($dbname);
if(!$db_connect)
{
databaseconnect();
}
}
// Call to connect
databaseconnect();-
www.freemysql.net
- Forum Newbie
- Posts: 2
- Joined: Thu Jun 15, 2006 3:35 am