SQL
SQL Interface
Describes SQL interface.
escape
Escapes special characters in a string for use in an SQL statement.
$escaped_string = $database->escape($unescaped_string);
isFunction
Check if data expression is sql function.
$is_function = $database->isFunction($expression);
execute
Return an instance with executed query command. Throw DatabaseException if error.
$database = $database->execute($command);
getInsertId
Retrieve the ID generated in the last execute() operation.
$insert_id = $database->getInsertId();
getAffectedRows
Retrieve number of affected rows in the last execute() operation.
$affected_rows = $database->getAffectedRows();
getExecuted
Retrieve the last command that was run in execute() operation.
$executed = $database->getExecuted();
query
Retrieve records from query command. Throw DatabaseException if error.
$records = $database->query($command);
getQueried
Retrieve the last command that was run in query() operation.
$queried = $database->getQueried();