PHP Manual
Prev |  | Next

# mysql_errno

mysql_errno -- Returns the number of the error message from previous MySQL operation

## Description

`int mysql_errno`(int [link_identifier] );

Errors coming back from the mySQL database backend no longer issue warnings. Instead, use these functions to retrieve the error number.

      1
      2 <?php
      3 mysql_connect("marliesle");
      4 echo mysql_errno().": ".mysql_error()."<BR>";
      5 mysql_select_db("nonexistentdb");
      6 echo mysql_errno().": ".mysql_error()."<BR>";
      7 $conn = mysql_query("SELECT * FROM nonexistenttable");
      8 echo mysql_errno().": ".mysql_error()."<BR>";
      9 ?>
     10

See also: mysql_error()

Prev | Home | Next
mysql_drop_db | Up | mysql_error