[Phplib-users] DB Error Reporting Broken?
Brought to you by:
nhruby,
richardarcher
From: Andrew C. <An...@Ev...> - 2003-04-06 03:55:10
|
Greetings, Do the SQL error reporting functions not work or am I misunderstanding something? If I run this snippet of code: >$db = new DB_Example; >$db->Halt_On_Error = "report"; >$query = "SELECT * FROM emptytable"; >$db->query($query); >echo "Error = " . $db->Error . "<p />\n"; //debugging >echo "Errno = " . $db->Errno . "<p />\n"; //debugging ... when emptytable contains no data, I get this output: >Error = > >Errno = 0 > >Database error: seek(0) failed: result has 0 rows. >MySQL Error: 0 () Based on the docs, it seems like $db->error should contain "Database error: seek(0) failed: result has 0 rows" or some subset of that. The output for the scripts I am writing is all templated. I would really like to be able to turn off the default error messages (the "Database error: seek(0) failed ...," etc.,) which display unattractively at the top of the page, and output them as an error message within the page. I know I can turn off Halt_On_Error completely but, since $db->Error is empty and $db->Errno is 0, regardless of what happens, that eliminates any indication of an error state. It's not a big deal with this particular error but, I worry that turning off error reporting completely will cause me to miss more important errors. Andrew Crawford An...@Ev... |