WHOW .. what a great new function in PHP4.3 .. I now have my errorlog populated with stuff like:
[Fri 15 Aug 2003 17:34] [error] [database] You have an error in your SQL syntax near 'DELETESBLAH' at line 1 -- -> database->execute() @ HTML/tmp/test.php line 3 ---- -> database->dberror() @ lib/class.database.inc.php line 63 ------ -> logging->error() @ lib/class.database.inc.php line 173 only 'bad' thing is that it converts my function names to all lowercase .. logging->error() should actually be Logging->Error() .. well, think I'll have to live with that :( Thanks you all ! Wouter Ps. invoking phpinfo() on a production website? I don't think so ;P -----Oorspronkelijk bericht----- Van: Jaap van Ganswijk [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 15 augustus 2003 16:51 Aan: [EMAIL PROTECTED] Onderwerp: RE: [PHP] Determining where a function is called from.. At 2003-08-15 16:35 +0200, Wouter van Vliet wrote: >I noticed the __LINE__ and __FUNCTION__ magic constants too, but they don't >really contain the values I was looking for, as they have the current >function and line in it. But what I want my Logging class (I have one too >:D) to display is what I am about to illustrate with an example: > >script: index.php >----------------- > 01 $Database->connect('host', 'database', 'username', 'password'); > (...) > 20 $Database->execute('DELETE news WHERE id IN ()'); > > -> this would produce an error in my Database class, error in sql syntax > >...etc. Have you studied this: http://www.php.net/manual/en/function.debug-backtrace.php You may also want to invoke phpinfo() at the place the error is occuring. There are more nice functions on: http://www.php.net/manual/en/ref.errorfunc.php Greetings, Jaap -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php