ifx_error

(PHP 3 >= 3.0.3, PHP 4, PHP 5)

ifx_error -- Returns error code of last Informix call

Description

string ifx_error ( void )

The Informix error codes (SQLSTATE & SQLCODE) formatted as follows :

x [SQLSTATE = aa bbb SQLCODE=cccc]

where x = space : no error

E : error

N : no more data

W : warning

? : undefined

If the "x" character is anything other than space, SQLSTATE and SQLCODE describe the error in more detail.

See the Informix manual for the description of SQLSTATE and SQLCODE

Returns in a string one character describing the general results of a statement and both SQLSTATE and SQLCODE associated with the most recent SQL statement executed. The format of the string is "(char) [SQLSTATE=(two digits) (three digits) SQLCODE=(one digit)]". The first character can be ' ' (space) (success), 'W' (the statement caused some warning), 'E' (an error happened when executing the statement) or 'N' (the statement didn't return any data).

See also: ifx_errormsg()


add a note add a note User Contributed Notes
nicks at baygate dot com
25-Apr-2000 04:35
You can do the queries ROLLBACK WORK, BEGIN WORK, COMMIT WORK with a call to
ifx_query()
Below is an example of how I handle a rollback.
function failure_exit()
{
   global $conn;
   $exec = ifx_query("ROLLBACK WORK", $conn);
   if(!$exec)
   {
     $err = ifx_errormsg();
     HandleError("db","other","failure_exit():ifx_query():  'ROLLBACK WORK' - $err", 0);
   }
   @ifx_close($conn);
   exit();
}