Error 1040 too many connection mysql / php

0

I have an error 1040 too many connection . I have seen that this can be solved by increasing the variable max_connection , but this variable can not be increased, the value of this variable is 101 which alternative I can use to solve this error

My code for the connection to the database is as follows

<?php
$conexion = new mysqli("localhost", "root", "", "grupomv");
$conexion->set_charset('utf8');
if($conexion->connect_errno) {
die ("Fallo al conectar a la BD: " . $conexion->connect_errno . "---" . $conexion->connect_error);
}
return $conexion;
?>

And this is my code that makes the query to the database

<?php
           include"conexion.php";
           $stmt = $conexion->prepare("select * from bio, caract where caract.IDBio=bio.IDBio and idprod=? LIMIT 1");
           $stmt->bind_param("i", $prod);               
           $stmt->execute();
           $result=$stmt->get_result();
           $stmt->close();
           $conexion->close();
            while($data=$result->fetch_assoc()){

             // muestro los resultados

          }
            ?>

Do I have a problem with the code?

Update These are the values that have the variables of the mysql, these variables I can not modify it since the hosting does not allow it

max_user_connections = 35 max_connections = 101

    
asked by Xiaron 06.06.2017 в 15:57
source

0 answers