You are here : phpmysqlimysqli_connect_errno

mysqli_connect_errno() - mysqli

The mysqli_connect_errno() function returns the error code from the last connection error, if any.


Syntax

mysqli_connect_errno();


Example

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


Output / Return Value


Limitations


Alternatives / See Also


Reference