IDatabaseDriver
in
Table of Contents
Methods
- debug() : mixed
- Debugs a Query, returns the processed query
- escape() : string
- Escapes a string
- getConnectionError() : null|string
- Gets the last Connection Error
- getFirstRow() : null|array<string|int, mixed>
- Returns the first row affected by a SQL query.
- getFirstRowColumn() : null|string
- Returns the specific column of the first row affected by a SQL query.
- getLastInsertId() : string|int
- Gets the ID assigned to the last inserted row
- getPrefix() : string|null
- Returns the current table prefix
- getRows() : null|array<string|int, mixed>
- Returns all rows from a SQL query.
- getRowsAffected() : int
- Gets the amount of rows affected by the last query
- getRowsOneColumn() : null|array<string|int, mixed>
- Returns a single column from all rows affected by a SQL query.
- hasRowsAffected() : int
- Executes a SQL query and returns the number of rows affected by it.
- isAlive() : bool
- Pings the Database and returns if the connection was successful
- isConnected() : bool
- Gets whether the Initial connection has been established
- setConfig() : mixed
- Sets the table configuration for the driver to use.
- setPrefix() : void
- Sets the table prefix to be used for all queries.
Methods
debug()
Debugs a Query, returns the processed query
public
debug(mixed $query[, mixed $inserts = null ][, mixed $hyphen = null ]) : mixed
Parameters
- $query : mixed
-
Query to execute
- $inserts : mixed = null
-
Escapable Inserts
- $hyphen : mixed = null
-
Hyphen for the inserts
escape()
Escapes a string
public
escape(mixed $str[, mixed $hyphen = null ]) : string
Parameters
- $str : mixed
-
String to escape
- $hyphen : mixed = null
-
Hyphen for the string
Return values
stringgetConnectionError()
Gets the last Connection Error
public
getConnectionError() : null|string
Return values
null|stringgetFirstRow()
Returns the first row affected by a SQL query.
public
getFirstRow(mixed $query[, mixed $inserts = null ][, mixed $hyphen = null ][, mixed $bypassCache = false ]) : null|array<string|int, mixed>
Parameters
- $query : mixed
-
The query to execute.
- $inserts : mixed = null
-
The values to be inserted into the query.
- $hyphen : mixed = null
-
The string to use as a placeholder for inserts.
- $bypassCache : mixed = false
-
Whether the cache should be bypassed
Return values
null|array<string|int, mixed> —The first row returned by the query or null if the query fails.
getFirstRowColumn()
Returns the specific column of the first row affected by a SQL query.
public
getFirstRowColumn(mixed $query, mixed $column[, mixed $inserts = null ][, mixed $hyphen = null ]) : null|string
Parameters
- $query : mixed
-
The query to execute.
- $column : mixed
-
The column to extract.
- $inserts : mixed = null
-
The values to be inserted into the
- $hyphen : mixed = null
Return values
null|stringgetLastInsertId()
Gets the ID assigned to the last inserted row
public
getLastInsertId() : string|int
Return values
string|intgetPrefix()
Returns the current table prefix
public
getPrefix() : string|null
Return values
string|null —The current table prefix or null if not set.
getRows()
Returns all rows from a SQL query.
public
getRows(mixed $query[, mixed $inserts = null ][, mixed $hyphen = null ][, mixed $bypassCache = false ]) : null|array<string|int, mixed>
Parameters
- $query : mixed
-
The query to execute.
- $inserts : mixed = null
-
The values to be inserted into the query.
- $hyphen : mixed = null
-
The string to use as a placeholder for inserts.
- $bypassCache : mixed = false
-
Whether the cache should be bypassed
Return values
null|array<string|int, mixed> —The rows returned by the query or null if the query fails.
getRowsAffected()
Gets the amount of rows affected by the last query
public
getRowsAffected() : int
Return values
intgetRowsOneColumn()
Returns a single column from all rows affected by a SQL query.
public
getRowsOneColumn(mixed $query, mixed $column[, mixed $inserts = null ][, mixed $hyphen = null ]) : null|array<string|int, mixed>
Parameters
- $query : mixed
-
The query to execute.
- $column : mixed
-
The column to extract.
- $inserts : mixed = null
-
The values to be inserted into the query.
- $hyphen : mixed = null
-
The string to use as a placeholder for inserts.
Return values
null|array<string|int, mixed> —The values of the specified column or null if the query fails.
hasRowsAffected()
Executes a SQL query and returns the number of rows affected by it.
public
hasRowsAffected(mixed $query[, mixed $inserts = null ][, mixed $hyphen = null ]) : int
Parameters
- $query : mixed
-
The query to execute.
- $inserts : mixed = null
-
The values to be inserted into the query.
- $hyphen : mixed = null
-
The string to use as a placeholder for inserts.
Return values
int —The number of rows affected.
isAlive()
Pings the Database and returns if the connection was successful
public
isAlive() : bool
Return values
boolisConnected()
Gets whether the Initial connection has been established
public
isConnected() : bool
Return values
boolsetConfig()
Sets the table configuration for the driver to use.
public
setConfig(mixed $data) : mixed
Parameters
- $data : mixed
-
The configuration data.
setPrefix()
Sets the table prefix to be used for all queries.
public
setPrefix(mixed $dbPrefix) : void
Parameters
- $dbPrefix : mixed
-
The prefix for the table names.