diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index de9ec2c0ec..c81772b6ae 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -428,6 +428,20 @@ class dao echo $this->processSQL(); } + /** + * Explain sql. + * + * @param string $sql + * @access public + * @return void + */ + public function explain($sql = '') + { + $sql = empty($sql) ? $this->processSQL() : $sql; + $result = $this->dbh->query('explain ' . $sql)->fetch(); + a($result); + } + /** * Process the sql, replace the table, fields. *