Problem w/ifx_error???

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I have an interesting problem that I'm not sure if it's a bug, or just
a mistake on my part. This is Informix IDS running on SuSE w/Apache.
The DB runs just's trapping errors in PHP that has become an


$db  = ifx_connect(...);
$sql = ifx_query("insert blah...", $db);
$err = ifx_error();

If I print out the value of $err, I get:
 [SQLSTATE=00 000 SQLCODE=-239]

According to the informix/PHP pages, if I get an error (and to me,
SQLCODE=-239 is an error), the first character should NOT be a blank.
In this case it is (BTW...the -239 is completely correct). I have no
idea why.

If, after the $err statement above, I stick in:
ereg("parse statement", $err, $r);

The value of $r is ALWAYS null, even $r[0];

If, on the other hand, I replace $err = ifx_error() with:

$err = " [SQLSTATE=00 000 SQLCODE=-239]";

followed by the same ereg, I get the complete string above parsed

Any ideas what is wrong or what I should be doing different??


Site Timeline