Db::eval
Usage
?mixed Db::eval(string $sql)Description
Evaluate SQL statement. Used to include SQL statement within queries (eg. now(), et al)Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$sql | Yes | string | The SQL statement to evaluate. |
Return Value
Will return whatever the results of the SQL evaluation are.Examples
Include now() in Insert
$this->db->insert('some_table', [
'name' => 'John Smith',
'created_at' => $this->db->eval('now()')
]);