0

My site contains a "Developers Window" which shows various breakdowns on the query's ran to produce the current page. But obviously due to the nature of the site we've got maybe 10 files all included to create one page.

We're using a PDO class and we wanted a way to display the file in which ran the query, and even better if possible the line number.

My only approach would be to add in the filename each time we run a query.

$dB->fetchRow('DO QUERY', FILE_NAME);

Anyone got any way we could implement this?

Thanks,

4

1 回答 1

1

您可以使用debug_backtrace查看哪个文件调用了您的函数。

http://ca2.php.net/manual/en/function.debug-backtrace.php

于 2012-06-18T13:35:16.153 回答