INGRES_ERRNO(3) 1 INGRES_ERRNO(3)
ingres_errno - Get the last Ingres error number generated
SYNOPSIS
int ingres_errno ([resource $link])
DESCRIPTION
Returns an integer containing the last error number. If no error was reported 0 is returned.
If a $link resource is passed to ingres_errno(3) it returns the last error recorded for the link. If no link is passed, then
ingres_errno(3) returns the last error reported using the default link.
The function, ingres_errno(3), should always be called after executing a database query. Calling another function before ingres_errno(3)
is called will reset or change any error code from the last Ingres function call.
PARAMETERS
o $link
- The connection link identifier
RETURN VALUES
Returns an integer containing the last error number. If no error was reported, 0 is returned.
EXAMPLES
Example #1
Get the last Ingres error number generated
<?php
$link = ingres_connect($database, $user, $password);
$result = ingres_query($link, "select * from table");
$error_code = ingres_errno($link);
if ( $error_code != 0 ) {
echo "An error occurred - " . $error_code;
}
?>
SEE ALSO
ingres_error(3), ingres_errsqlstate(3), ingres_next_error(3).
PHP Documentation Group INGRES_ERRNO(3)