You are here : phpmysqlimysqli_connect_error

mysqli_connect_error() - mysqli

The mysqli_connect_error() function returns the error description from the last connection error, if any.


Syntax

mysqli_connect_error();


Example

<?php
$con=mysqli_connect("localhost","wrong_user","my_password","my_db");
// Check connection
if (!$con)
  {
  die("Connection error: " . mysqli_connect_error());
  }
?>


Output / Return Value


Limitations


Alternatives / See Also


Reference