SQL Interface

Describes SQL interface.


isConnected

Check if driver is connected to database.

$is_connected = $sql->isConnected();

connectionErrorCode

Retrieve connection error code.

$error_code = $sql->connectionErrorCode();

connectionErrorMessage

Retrieve connection error message.

$error_message = $sql->connectionErrorMessage();

escape

Escapes special characters in a string for use in an SQL statement.

$escaped_string = $sql->escape($unescaped_string);

isFunction

Check if data expression is sql function.

$is_function = $sql->isFunction($data);

execute

Return an instance with executed query command.

$sql = $sql->execute($command);

executeInsertId

Retrieve the ID generated in the last execute() operation.

$insert_id = $sql->executeInsertId();

executeAffectedRows

Retrieve number of affected rows in the last execute() operation.

$affected_rows = $sql->executeAffectedRows();

executeLastCommand

Retrieve the last query that was run in execute() operation.

$last_command = $sql->executeLastCommand();

executeErrorCode

Retrieve the last error code that was run in execute() operation.

$error_code = $sql->executeErrorCode();

executeErrorMessage

Retrieve the last error message that was run in execute() operation.

$error_message = $sql->executeErrorMessage();

query

Retrieve records from query command.

$records = $sql->query($command);

queryLastCommand

Retrieve the last query that was run in query() operation.

$last_command = $sql->queryLastCommand();

queryErrorCode

Retrieve the last error code that was run in query() operation.

$error_code = $sql->queryErrorCode();

queryErrorMessage

Retrieve the last error message that was run in query() operation.

$error_message = $sql->queryErrorMessage();