mysql_errno

mysql_errno -- 一番最近の mysql コールにおけるエラー番号を返します

説明

int mysql_errno();

mySQL データベースバックエンドから返ってくるエラーは、 警告を発生しません。代わりにエラー番号を得るためにこれらの関数を 使用して下さい。

<?php
mysql_connect("marliesle");
echo mysql_errno().": ".mysql_error()."<BR>";
mysql_select_db("nonexistentdb");
echo mysql_errno().": ".mysql_error()."<BR>";
$conn = mysql_query("SELECT * FROM nonexistenttable");
echo mysql_errno().": ".mysql_error()."<BR>";
?>

mysql_error() も参照下さい。