Код: Выделить всё
SQLSTATE[HY000] [1203] User *USERNAMEHERE* already has more than 'max_user_connections' active connectionsЯ думал, что правильно закрываю соединения, присваивая ему NULL. Вот моя функция, есть идеи, почему я использую максимум?
Код: Выделить всё
function mysql_read_single_row($sql, $array_of_values) {
try {
//create a connection
$DBH = new PDO("mysql:host=".CONST_MYSQL_HOST.";dbname=".CONST_MYSQL_DBNAME, CONST_MYSQL_RUSER, CONST_MYSQL_RPASS);
//set the sql
$STH = $DBH->prepare($sql);
//execute query
$STH->execute($array_of_values);
}
catch(PDOException $e) {
echo $e->getMessage();
return false;
}
$return_row = $STH->fetch(PDO::FETCH_ASSOC);
//close the connection
$STH = null;
$DBH = null;
//strip any escaped quotes from the data
$return_row = array_map('stripslashes', $return_row);
//return the array
return $return_row;
}
Подробнее здесь: https://stackoverflow.com/questions/365 ... er-connect
Мобильная версия