X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP mysqli_connect_errno() Function

PHP MySQLi Reference PHP MySQLi Reference

Example

Return an error code from the last connection error, if any:

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

Definition and Usage

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


Syntax

mysqli_connect_errno();

Technical Details

Return Value: Returns an error code value. Zero if no error occurred
PHP Version: 5+


PHP MySQLi Reference PHP MySQLi Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook