PHP Database

SqlInterface

Describes SQL interface.

Table of Contents

Methods

escape()  : string
Escapes special characters in a string for use in an SQL statement.
execute()  : static
Return an instance with executed query command.
getAffectedRows()  : int
Retrieve number of affected rows in the last execute() operation.
getExecuted()  : string
Retrieve the last command that was run in execute() operation.
getInsertId()  : int
Retrieve the ID generated in the last execute() operation.
getQueried()  : string
Retrieve the last command that was run in query() operation.
isFunction()  : bool
Check if data expression is sql function.
query()  : array<string|int, array<string, mixed>>
Retrieve records from query command.

Methods

escape()

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

public escape(string $UnescapedString) : string
Parameters
$UnescapedString : string

The unescaped string.

Return values
string

execute()

Return an instance with executed query command.

public execute(string $Command) : static
Parameters
$Command : string

The sql command.

Tags
throws
DatabaseException

If error.

Return values
static

getAffectedRows()

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

public getAffectedRows() : int
Return values
int

getExecuted()

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

public getExecuted() : string
Return values
string

getInsertId()

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

public getInsertId() : int
Return values
int

getQueried()

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

public getQueried() : string
Return values
string

isFunction()

Check if data expression is sql function.

public isFunction(string $Expression) : bool
Parameters
$Expression : string

The sql expression.

Return values
bool

query()

Retrieve records from query command.

public query(string $Command) : array<string|int, array<string, mixed>>
Parameters
$Command : string

The sql command.

Tags
throws
DatabaseException

If error.

Return values
array<string|int, array<string, mixed>>

        
On this page

Search results