Re: display error line in object method

From: Date: Wed, 10 Aug 2005 15:34:01 +0000
Subject: Re: display error line in object method
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220342@lists.php.net to get a copy of this message
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:joro@abacustrade.com] > > > 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 Developer www.smartertravel.com > mike@smarterliving.com (617) 886-5539

« previous php.general (#220342) next »