For Cake 2.0, the query log is protected so this will work
function getLastQuery() {
$dbo = $this->getDatasource();
$logs = $dbo->getLog();
$lastLog = end($logs['log']);
return $lastLog['query'];
}
More Related Contents:
- Cakephp Career Database Design
- How to show the last queries executed on MySQL?
- How to enable MySQL Query Log?
- Log all queries in mysql
- How to see log files in MySQL?
- MySQL/Writing file error (Errcode 28)
- i have an error which i dont understand. can you help me? [closed]
- How to group by week in MySQL?
- Can I use a function for a default value in MySql?
- Mysql order by specific ID values
- How do I check if a column is empty or null in MySQL?
- MySQL versus PDO [duplicate]
- What is this operator in MySQL?
- SELECT * WHERE NOT EXISTS
- Row number per group in mysql
- Resetting ROOT password in MySQL 5.6
- MySQL #1093 – You can’t specify target table ‘giveaways’ for update in FROM clause
- Field ‘id’ doesn’t have a default value?
- “SELECT COUNT(*)” is slow, even with where clause
- is there a mysql function to decode html entities?
- MySQL fails on: mysql “ERROR 1524 (HY000): Plugin ‘auth_socket’ is not loaded”
- MySQL – SQL_BIG_SELECTS
- How to use unsigned int / long types with Entity Framework?
- How to Prevent Connection Timeouts for Large MySQL Imports
- Can I launch a trigger on select statement in mysql?
- How do you write a case insensitive query for both MySQL and Postgres?
- How to use MySQL DECIMAL?
- MySQL: return updated rows
- SQL doesnt differentiate u and ü although collation is utf8mb4_unicode_ci
- Mysql stored procedure don’t take table name as parameter