Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
CakePHP - Display last executed SQL query
$dbo = $this->Job->getDatasource();
$logs = $dbo->getLog();
$lastLog = end($logs['log']);
debug( $lastLog['query'] );
Copy link

EOM commented Oct 16, 2017

Is for CakePHP 2.X only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment