Returns the error description of the last connection error:
<?php$con = mysqli_connect ( "localhost" , "wrong_user" , "my_password" , "my_db" ); // Check connection if (! $con ){ die( "Connection error: " . mysqli_connect_error ();} ? >The mysqli_connect_error() function returns the error description of the last connection error.
mysqli_connect_error() ;
Return value: | Returns a string describing the error. Returns NULL if no error occurs. |
---|---|
PHP version: | 5+ |