WIKINDX API trunk

SQL
in package

SQL

SQL abstraction layer for using MySQL.

Table of Contents

Properties

$collateSet  : bool
bool
$endTimer  : float|null
mixed
$group  : mixed
string
$handle  : mysqli|null
object
$joinUpdate  : array<string|int, mixed>
array
$limit  : mixed
string
$startTimer  : float|null
mixed

Methods

detectDatabaseEngineVersion()  : bool
Detect the MySql/MariaDB engine version and set constant for next calls
elapsedTime()  : float
Return the time elapsed betwen two UNIX timestamp with microseconds
formatAlias()  : string
Format fields as aliases
formatAliasWithExceptions()  : string
Format fields as aliases
formatUpdate()  : string
Format fields for an UPDATE statement
formatValues()  : string
Format field values for database type
getExecutionError()  : mixed
Get error information from db drivers at connection
internalQuery()  : bool|array<string|int, mixed>|null
Execute queries and return recordset
sqlDie()  : mixed
Die or throw an exception depending on the configuration
sqlTimerOff()  : mixed
Turn SQL timer OFF
sqlTimerOn()  : mixed
Turn SQL timer ON
subClause()  : string
Formulate subclause after main query

Properties

$collateSet

bool

private bool $collateSet = \FALSE

$endTimer

mixed

private float|null $endTimer

$group

string

private mixed $group = \FALSE

$handle

object

private mysqli|null $handle = \NULL

$joinUpdate

array

private array<string|int, mixed> $joinUpdate = []

$limit

string

private mixed $limit = \FALSE

$startTimer

mixed

private float|null $startTimer

Methods

detectDatabaseEngineVersion()

Detect the MySql/MariaDB engine version and set constant for next calls

private detectDatabaseEngineVersion() : bool
Return values
bool

elapsedTime()

Return the time elapsed betwen two UNIX timestamp with microseconds

private elapsedTime() : float
Return values
float

formatAlias()

Format fields as aliases

private formatAlias(array<string|int, mixed> $array[, bool $table = FALSE ][, bool $tidyLeft = TRUE ]) : string
Parameters
$array : array<string|int, mixed>

[VALUE => ALIAS]

$table : bool = FALSE

Default is FALSE. If TRUE, prepend VALUE to ALIAS

$tidyLeft : bool = TRUE

Default is TRUE. If FALSE, do not quote the left hand side of the alias

Return values
string

formatAliasWithExceptions()

Format fields as aliases

private formatAliasWithExceptions(array<string|int, mixed> $array[, bool $tidyLeft = TRUE ]) : string

Array keys are checked for UNIX_TIMESTAMP or DATE_FORMAT

Parameters
$array : array<string|int, mixed>

[VALUE => ALIAS]

$tidyLeft : bool = TRUE

Default is TRUE. If FALSE, do not quote the left hand side of the alias

Return values
string

formatUpdate()

Format fields for an UPDATE statement

private formatUpdate(array<string|int, mixed> $array) : string
Parameters
$array : array<string|int, mixed>
Return values
string

formatValues()

Format field values for database type

private formatValues(array<string|int, mixed>|string|null $values) : string
Parameters
$values : array<string|int, mixed>|string|null

Array of values or single value

Return values
string

getExecutionError()

Get error information from db drivers at connection

private getExecutionError() : mixed

internalQuery()

Execute queries and return recordset

private internalQuery(string $querystring) : bool|array<string|int, mixed>|null

If WIKINDX_DEBUG_SQL is TRUE then the script always die on db error.

Parameters
$querystring : string
Return values
bool|array<string|int, mixed>|null

An array, or a boolean if there are no data to return. Only the first result set is returned

sqlDie()

Die or throw an exception depending on the configuration

private sqlDie(string $errorMessage[, string $beautified = "" ]) : mixed
Parameters
$errorMessage : string
$beautified : string = ""

Offending SQL statement

sqlTimerOff()

Turn SQL timer OFF

private sqlTimerOff() : mixed

sqlTimerOn()

Turn SQL timer ON

private sqlTimerOn() : mixed

subClause()

Formulate subclause after main query

private subClause() : string
Return values
string

        
On this page

Search results