I have defined a query($query) function that not only performs the mysql_query($query) function, but also handles error handling. For example, if something goes wrong with the query, it'll record the query and the error message MySQL returned.
I would also like to know the line number on which the error was called from. I'm aware of the LINE constant, but here's the problem. Since the query() function is in an included file (core.php for me), the line number is always the same. Is there a way to get the line number for the calling script, instead of the line number from inside the included file?
I hope I'm making sense. I know that I could just make the function query($query,$lineNumber) and then modify all of the places where query() is called, but there are literally thousands of them and I don't really have time for that.
Thanks!