$this->information .= '<b>sql error:</b> ' . StringUtil::encodeHTML($this->getErrorDesc()) . '<br />';
$this->information .= '<b>sql error number:</b> ' . StringUtil::encodeHTML($this->getErrorNumber()) . '<br />';
$this->information .= '<b>sql version:</b> ' . StringUtil::encodeHTML($this->getSQLVersion()) . '<br />';
- if ($this->preparedStatement !== null) $this->information .= '<b>sql query:</b> ' . StringUtil::encodeHTML($this->preparedStatement->getSQLQuery()) . '<br />';
-
- $this->information .= "\n<!-- db error: #".$this->db->getErrorNumber().': '.$this->db->getErrorDesc()." -->\n";
if ($this->preparedStatement !== null) {
- $this->information .= "\n<!-- statement error: #".$this->preparedStatement->getErrorNumber().': '.$this->preparedStatement->getErrorDesc()." -->\n";
+ $this->information .= '<b>sql query:</b> ' . StringUtil::encodeHTML($this->preparedStatement->getSQLQuery()) . '<br />';
+ $parameters = $this->preparedStatement->getSQLParameters();
+ if (!empty($parameters)) {
+ foreach ($parameters as $index => $parameter) {
+ $this->information .= '<b>sql query parameter ' . $index . ':</b>' . StringUtil::encodeHTML($parameter) . '<br />';
+ }
+ }
}
parent::show();
*/
protected $database = null;
+ /**
+ * SQL query parameters
+ * @var array
+ */
+ protected $parameters = array();
+
/**
* pdo statement object
*
* @param array $parameters
*/
public function execute(array $parameters = array()) {
+ $this->parameters = $parameters;
$this->database->incrementQueryCount();
$this->database->beginTransaction();
* @param array $parameters
*/
public function executeUnbuffered(array $parameters = array()) {
+ $this->parameters = $parameters;
$this->database->incrementQueryCount();
try {
public function getSQLQuery() {
return $this->query;
}
+
+ /**
+ * Returns the SQL query parameters of this statement.
+ *
+ * @return array
+ */
+ public function getSQLParameters() {
+ return $this->parameters;
+ }
}