(PHP3 , PHP4 )
mysql_errno -- Returns the numerical value of the error message from previous MySQL operationint 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()