__LINE__ in include

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Geradeaus

    __LINE__ in include

    Hello,

    I am using a database class for my php projects, but I want to know if it is
    possible to retrieve the line number of the "parent file" : I want to use it
    for error reporting.

    E.g. When a query fails, I don't know the line number of the parent file
    where the query is executed... very annoying.

    Thanks.


  • Dana Cartwright

    #2
    Re: __LINE__ in include

    From: "Geradeaus" <gehegeradeaus_ nospam_@hotmail .com>[color=blue]
    > I am using a database class for my php projects, but I want to know if it
    > is possible to retrieve the line number of the "parent file" : I want to
    > use it for error reporting.
    >
    > E.g. When a query fails, I don't know the line number of the parent file
    > where the query is executed... very annoying.
    >[/color]

    It might be the case that debug_backtrace will give you the information you
    need.

    I'm not sure I understand your question, but if the problem is that you are
    including a file, and within that included file you detect an error, and you
    want to report where the included file was included from, then
    debug_backtrace is your friend.


    Comment

    • Geradeaus

      #3
      Re: __LINE__ in include


      "Dana Cartwright" <danapub2@weave maker.com> schreef in bericht
      news:S2CTf.1114 7$Da7.3071@twis ter.nyroc.rr.co m...[color=blue]
      > From: "Geradeaus" <gehegeradeaus_ nospam_@hotmail .com>[color=green]
      >> I am using a database class for my php projects, but I want to know if it
      >> is possible to retrieve the line number of the "parent file" : I want to
      >> use it for error reporting.
      >>
      >> E.g. When a query fails, I don't know the line number of the parent file
      >> where the query is executed... very annoying.
      >>[/color]
      >
      > It might be the case that debug_backtrace will give you the information
      > you need.
      >
      > I'm not sure I understand your question, but if the problem is that you
      > are including a file, and within that included file you detect an error,
      > and you want to report where the included file was included from, then
      > debug_backtrace is your friend.[/color]

      That's what I'm looking for, thanks!


      Comment

      Working...