Demo 3 - Connecting to an Informix Database
\n";
chk_ifx_err1($connect_id);
} else {
echo "Informix connection successful!
";
}
/*********************************************************************/
function chk_ifx_err1($result_id)
/*********************************************************************/
{
/**************************************************
The ifx_error function return the following string:
x [SQLSTATE = aa bbb SQLCODE=cccc]
where x = space : no error
E : error
N : no more data
W : warning
? : undefined
*************************************************/
$err_string = ifx_error($result_id);
if ($err_string[0] == ' ') return;
printf("
Informix error: %s
\n%s
\n", ifx_error($result_id), ifx_errormsg());
die;
}
?>