Skip to main content
improved formatting
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

If grep/ack-grepgrep/ack-grep can't find a SELECT * (likely) then just add an $debug_query = 'SELECTSELECT * FROM {mytable}'; if (substr($query, 0, strlen($debug_query)) == $debug_query) error_log(print_r(debug_backtrace(), TRUE), 4) or match the whole query etc and then look at the Apache error log for the pouring in backtraces. If you dont want to trash the log, log into a file in /tmpjust add the following code.

$debug_query = 'SELECT * FROM {mytable}';
if (substr($query, 0, strlen($debug_query)) == $debug_query) {
  error_log(print_r(debug_backtrace(), TRUE), 4);
}

If grep/ack-grep can't find a SELECT * (likely) then just add an $debug_query = 'SELECT * FROM {mytable}'; if (substr($query, 0, strlen($debug_query)) == $debug_query) error_log(print_r(debug_backtrace(), TRUE), 4) or match the whole query etc and then look at the Apache error log for the pouring in backtraces. If you dont want to trash the log, log into a file in /tmp.

If grep/ack-grep can't find SELECT *, just add the following code.

$debug_query = 'SELECT * FROM {mytable}';
if (substr($query, 0, strlen($debug_query)) == $debug_query) {
  error_log(print_r(debug_backtrace(), TRUE), 4);
}
Post Made Community Wiki by avpaderno
Source Link
user49
user49

If grep/ack-grep can't find a SELECT * (likely) then just add an $debug_query = 'SELECT * FROM {mytable}'; if (substr($query, 0, strlen($debug_query)) == $debug_query) error_log(print_r(debug_backtrace(), TRUE), 4) or match the whole query etc and then look at the Apache error log for the pouring in backtraces. If you dont want to trash the log, log into a file in /tmp.