Re: [PHP] display error line in object method
Richard Lynch wrote: There may also be some fancy new way to output the whole stack of functions called... I haven't really checked that out yet. The function stack is printed by debug_backtrace(), isn't it? Supported by PHP since 4.3.0. Norbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display error line in object method
On 8/10/05, Georgi Ivanov <[EMAIL PROTECTED]> wrote: > Hi, > I have a db wrapper class. > I use it like this : > $db->query"(SQL HERE") or die ($db->error()); > Is there a way to display the line on which $db->error() is executed without > doing die (__LINE__." ".$db->error() )? http://us3.php.net/debug_backtrace Wouldn't that work? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display error line in object method
On Wed, August 10, 2005 8:10 am, Georgi Ivanov wrote: > Hi, > I have a db wrapper class. > I use it like this : > $db->query"(SQL HERE") or die ($db->error()); > Is there a way to display the line on which $db->error() is executed > without > doing die (__LINE__." ".$db->error() )? Sure! Use these guys: http://php.net/trigger_error http://php.net/set_error_handler > If i put __LINE__ in the class the line number is always the line in the > class > file. > > I want when i call $db->error() to display the current line number. There may also be some fancy new way to output the whole stack of functions called... I haven't really checked that out yet. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] display error line in object method
From: Georgi Ivanov [mailto:[EMAIL PROTECTED] > Thank you for the replay. > I know i can pass __LINE to $db->error(). > This is not the idea. I want $db->error() to print the line > on which it was > executed . > $parent::__LINE__ > Who is the $parent here ? There isn't, necessarily. That was pseudo-code to demonstrate what I thought you were asking about. The point of my reply was "I don't think it's possible to do what you want to do here," and offer up an alternative in passing __LINE__ as an argument to error(). Good luck! -- Mike Johnson Smarter Living, Inc. Web Developerwww.smartertravel.com [EMAIL PROTECTED] (617) 886-5539 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display error line in object method
Thank you for the replay. I know i can pass __LINE to $db->error(). This is not the idea. I want $db->error() to print the line on which it was executed . $parent::__LINE__ Who is the $parent here ? On Wednesday 10 August 2005 18:20, Mike Johnson wrote: > From: Georgi Ivanov [mailto:[EMAIL PROTECTED] > > > Hi, > > I have a db wrapper class. > > I use it like this : > > $db->query"(SQL HERE") or die ($db->error()); > > Is there a way to display the line on which $db->error() is > > executed without > > doing die (__LINE__." ".$db->error() )? > > If i put __LINE__ in the class the line number is always the > > line in the class > > file. > > > > I want when i call $db->error() to display the current line number. > > Probably not the answer you're looking for, but I think your best option > may be to pass __LINE__ as an arg to error() and use it there as you > please. I don't know of any $parent::__LINE__ syntax, which is what it > sounds like you're asking about... > > -- > Mike Johnson Smarter Living, Inc. > Web Developerwww.smartertravel.com > [EMAIL PROTECTED] (617) 886-5539 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] display error line in object method
From: Georgi Ivanov [mailto:[EMAIL PROTECTED] > Hi, > I have a db wrapper class. > I use it like this : > $db->query"(SQL HERE") or die ($db->error()); > Is there a way to display the line on which $db->error() is > executed without > doing die (__LINE__." ".$db->error() )? > If i put __LINE__ in the class the line number is always the > line in the class > file. > > I want when i call $db->error() to display the current line number. Probably not the answer you're looking for, but I think your best option may be to pass __LINE__ as an arg to error() and use it there as you please. I don't know of any $parent::__LINE__ syntax, which is what it sounds like you're asking about... -- Mike Johnson Smarter Living, Inc. Web Developerwww.smartertravel.com [EMAIL PROTECTED] (617) 886-5539 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] display error line in object method
Hi, I have a db wrapper class. I use it like this : $db->query"(SQL HERE") or die ($db->error()); Is there a way to display the line on which $db->error() is executed without doing die (__LINE__." ".$db->error() )? If i put __LINE__ in the class the line number is always the line in the class file. I want when i call $db->error() to display the current line number. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php