WIKINDX API 6.4.14

SQL
in package

SQL

SQL abstraction layer for using MySQL.

Table of Contents

$endTimer  : mixed
mixed
$group  : mixed
string
$handle  : mixed
object
$joinUpdate  : mixed
array
$limit  : mixed
string
$startTimer  : mixed
mixed
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
getConnectionError()  : mixed
Get error information from db drivers at execution
getErrorMsg()  : bool
Return a DB error message (translated with Gettext)
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

$endTimer

mixed

private mixed $endTimer

$group

string

private mixed $group = FALSE

$handle

object

private mixed $handle = NULL

$joinUpdate

array

private mixed $joinUpdate = []

$limit

string

private mixed $limit = FALSE

$startTimer

mixed

private mixed $startTimer

Methods

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

getConnectionError()

Get error information from db drivers at execution

private getConnectionError() : mixed
Return values
mixed

getErrorMsg()

Return a DB error message (translated with Gettext)

private getErrorMsg(string $key) : bool
Parameters
$key : string
Return values
bool

getExecutionError()

Get error information from db drivers at connection

private getExecutionError() : mixed
Return values
mixed

internalQuery()

Execute queries and return recordset

private internalQuery(string $querystring[, bool $bNoError = FALSE ]) : bool|array<string|int, mixed>|null

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

Parameters
$querystring : string
$bNoError : bool = FALSE

Default is FALSE

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

Return values
mixed

sqlTimerOff()

Turn SQL timer OFF

private sqlTimerOff() : mixed
Return values
mixed

sqlTimerOn()

Turn SQL timer ON

private sqlTimerOn() : mixed
Return values
mixed

subClause()

Formulate subclause after main query

private subClause() : string
Return values
string

Search results