mardi 5 avril 2016

Why is the max number of users reached when there is only really one?

I am trying to make a website that is a bit heavy on queries (~2) every few seconds per user. So, after being on the website for a while, I get the message "Warning: mysqli_connect(): (42000/1226): User has exceeded the 'max_connections_per_hour' resource (current value: 1500) in connect.php on line 2". This file is included in every php file where needed.

Here is the connect.php :

<?php
$connection = mysqli_connect('...', '...', '...');
if (!$connection){
    die("Database Connection Failed" . mysqli_error(!connection));
}
$select_db = mysqli_select_db($connection, '2014998_lootcash');
if (!$select_db){
    die("Database Selection Failed" . mysqli_error(!connection));
}
?>

(I deleted the private info) So, there is only me on the website. Why does it keep giving me the message. I thought it would be because I didn't close the connection, but at the end of every script, I put "mysqli_close($connection)", and it still happens. How can I fix this?

Thank you in advance,

Bryce




Aucun commentaire:

Enregistrer un commentaire