Re: [Phplib-users] DB Error Reporting Broken?
Brought to you by:
nhruby,
richardarcher
From: Andrew C. <An...@Ev...> - 2003-04-06 05:10:41
|
At 02:22 PM 4/6/2003 +1000, you wrote: >At 20:52 -0700 5/4/03, Andrew Crawford wrote: > > >>$query = "SELECT * FROM emptytable"; > >>$db->query($query); > >That query is performed without error. It just returns no results. > >Check $db->num_rows() to make sure you have some results before >you start working with them. > > ...R. Okay. Thank you for the suggestion. I am already checking to make sure the result set is non-empty before I do anything with the results. That is not a problem. However, the default behavior for phplib is to display an error message for the query that is "performed without error." Unless I turn that off, the user will see an error message where there is no real error. If I do turn it off to avoid that, there will be no error message displayed if something else goes wrong ... So, out of the box, phplib will either display an error for a non-error condition or the programmer must write an error handling routine and turn off phplib's built-in error reporting. Admittedly, this is probably an uncommon scenario but, best I can tell, there is either a bug in phplib (for displaying an error message when there is no error) or a documentation oversight (for not specifying that the programmer must write an error handling routine.) Again, not a huge problem. I just wanted to be sure I wasn't missing something more subtle. Andrew Crawford An...@Ev... |