Skip to content

Instantly share code, notes, and snippets.

@mikedamoiseau
Created July 9, 2014 08:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikedamoiseau/111850d2c743c75ba6bd to your computer and use it in GitHub Desktop.
Save mikedamoiseau/111850d2c743c75ba6bd to your computer and use it in GitHub Desktop.
CakePHP - Display last executed SQL query
$dbo = $this->Job->getDatasource();
$logs = $dbo->getLog();
$lastLog = end($logs['log']);
debug( $lastLog['query'] );
@EOM
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