Created
July 10, 2015 00:49
-
-
Save nayibor/51843133896296d67fbc to your computer and use it in GitHub Desktop.
rawQuery_puzzle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* @param string $sql SQL statement | |
* @param array $params Additional options for the query. | |
* @return mixed Resource or object representing the result set, or false on failure | |
*/ | |
public function rawQuery($sql, $params = array()) { | |
$this->took = $this->numRows = false; | |
return $this->execute($sql, $params); | |
} | |
/** | |
* Queries the database with given SQL statement, and obtains some metadata about the result | |
* (rows affected, timing, any errors, number of rows in resultset). The query is also logged. | |
* If Configure::read('debug') is set, the log is shown all the time, else it is only shown on errors. | |
* | |
* ### Options | |
* | |
* - log - Whether or not the query should be logged to the memory log. | |
* | |
* @param string $sql SQL statement | |
* @param array $options The options for executing the query. | |
* @param array $params values to be bound to the query. | |
* @return mixed Resource or object representing the result set, or false on failure | |
*/ | |
public function execute($sql, $options = array(), $params = array()) { | |
$options += array('log' => $this->fullDebug); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment