Connection error mysqli [closed]

2

I have a problem with the following code. It seems that the connection is not closed or gives an error. The error it shows is:

  

Notice: Undefined variable: mysqli_close in   C: \ xampp \ htdocs \ new \ 89_Blog1 \ insertContent.php on line 23

     

Fatal error: Function name must be a string in   C: \ xampp \ htdocs \ new \ 89_Blog1 \ insertContent.php on line 23

<?php
$miconexion=mysqli_connect("localhost","root","","bdBlog");
if(!$miconexion){
    echo "La conexión ha fallado: ". error();
    exit();
}
    $mysqli_close($miconexion);

?>

What is the error?

    
asked by Adrian 06.06.2017 в 17:15
source

1 answer

8

Remove the $ of the function mysqli_close($miconexión)

<?php
$miconexion=mysqli_connect("localhost","root","","bdBlog");
if(!$miconexion){
    echo "La conexión ha fallado: ". error();
    exit();
}
mysqli_close($miconexion);

?>
    
answered by 06.06.2017 / 17:19
source