Get Last Executed Query in PHP PDO
<?php class MyPDOStatement extends PDOStatement { protected $_debugValues = null; protected function __construct() { // need this empty construct()! } public function execute($values=array()) { $this->_debugValues = $values; try { $t = parent::execute($values); // maybe do some logging here? } catch (PDOException $e) { // maybe do some logging here? throw $e; } return $t; } … Read more