my hosting pop this kind of error message during a flood of active user using my system online.. "has exceeded the 'max_connections_per_hour'"
Then the server provider said it was my connection code was not optimized.
===========
@session_start();
(CONNECTION VARIABLE ON TOP)
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
@mysql_select_db($database_userdb, $localhost);
@error_reporting(0);
===============
This was the code originally, then the server provider suggested me to change mysql_pconnect into PDO or mysqli connection
Then we change to this
try {
$pdo = new PDO('mysql:host='.$hostname_localhost.';dbname='.$database_userdb, $username_localhost, $password_localhost);
} catch (PDOException $e) {
echo $e->getMessage();
}
And that error "has exceeded the 'max_connections_per_hour'" still pop up.. And today the server provider suggested me that "the script should be using a persistent MySQL connections.", so am I going to change back the PDO into mysql_pconnect which is persistent MYSQL connection that we use originally..
Both connection works fine on the system, just that with a massive flow of traffic into the system, that error pops up on my web page..
By the way.. im using include("connection.php"); something like this on the page.. does that effect my persistent connection?
And how do I resolve this matter? Please help me..