db_error()
Determine whether the previous query caused an error.
includes/database.mysql.inc, line 247
<?php function db_error() { global $active_db; return mysql_errno($active_db); } ?>