Documentation

PDO extends SQL
in package

PDO Helper Class.

Tags
author

Vitex vitex@hippy.cz

Table of Contents

Properties

$charset  : mixed
$collate  : mixed
$connectionSettings  : array<string, string>
Connection settings properties.
$data  : array<string, mixed>
Auxiliary variable for data operations.
$database  : string
Current database name.
$dbType  : string
Database Type: mysql|sqlite|sqlsrv etc .
$debug  : bool
Debug mode.
$explainMode  : bool
Allow Explain of each command to log logu ?
$keyColumn  : string
KeyColumn used row key.
$lastInsertID  : int
Value of the last inserted AutoIncrement column.
$lastMessage  : string
Last message received from the SQL server.
$lastQuery  : string
Last SQL query executed.
$myTable  : string
Table name we used.
$numRows  : int
Last Query result length.
$pdo  : PDO|null
DBO class instance.
$report  : array<string, string>
Array containing information about basic SQL connection parameters.
$result  : PDOStatement
SQLLink result.
$resultArray  : array<string, mixed>
Array containing the results of the last SQL command.
$sqlLink  : resource
SQL Handle.
$status  : bool
Connected state ?
$tableName  : string
Name of the currently processed table.
$tableStructure  : array<string, string>
Array containing the structure of the SQL table.
$connectAllreadyUP  : bool
Indicator of connection settings - SET commands have been executed.
$errorNumber  : int
Last error number.
$_instance  : mixed
Saves object instance (singleton...).
$errorText  : string

Methods

__construct()  : mixed
General database object.
__destruct()  : mixed
cleanup.
__sleep()  : bool
Resets the last query when serializing.
__wakeup()  : void
addSlashes()  : string
Escapes special characters in a string for use in an SQL statement.
arrayToSetQuery()  : string
From the $data array, creates a fragment of the SQL query for WHERE (the key column $this->keyColumn is skipped if $key is false).
close()  : mixed
Ukončí připojení k databázi.
connect()  : void
Connect to the database.
getColumnComma()  : string
Returns quotes for column names.
getInsertID()  : int
ID returned after INSERT.
getLastError()  : string
Returns the SQL error message.
getlastInsertID()  : int
Poslední genrované ID.
getLastQuery()  : int
Last executed query.
getNumRows()  : int
Returns the number of rows returned or affected by the last SQL query.
isConnected()  : bool
Return connect status.
logSqlError()  : mixed
Do when SQL error occurs.
ping()  : bool
Test the possibility of connecting to the SQL server.
sanitizeQuery()  : string
Removes "dangerous" characters from the SQL query.
selectDB()  : bool
Změní aktuálně použitou databázi.
setKeyColumn()  : bool
Set KeyColumn used for PGSQL indertid.
setTable()  : void
setTableName()  : bool
Set Table we work with.
setUp()  : bool
SetUp Object to be ready for connect.
singleton()  : mixed
Pri vytvareni objektu pomoci funkce singleton (ma stejne parametry, jako konstruktor) se bude v ramci behu programu pouzivat pouze jedna jeho instance (ta prvni).

Properties

$charset

public mixed $charset = 'utf8'

$collate

public mixed $collate = 'utf8_czech_ci'

$connectionSettings

Connection settings properties.

public array<string, string> $connectionSettings = []

$data

Auxiliary variable for data operations.

public array<string, mixed> $data = []

$database

Current database name.

public string $database = ''

$dbType

Database Type: mysql|sqlite|sqlsrv etc .

public string $dbType = ''

..

$debug

Debug mode.

public bool $debug = false

$explainMode

Allow Explain of each command to log logu ?

since version 1.4

public bool $explainMode = false

$keyColumn

KeyColumn used row key.

public string $keyColumn = ''

$lastInsertID

Value of the last inserted AutoIncrement column.

public int $lastInsertID = 0

unsigned

$lastMessage

Last message received from the SQL server.

public string $lastMessage = ''

$lastQuery

Last SQL query executed.

public string $lastQuery = ''

$myTable

Table name we used.

public string $myTable = ''

$numRows

Last Query result length.

public int $numRows = 0

$pdo

DBO class instance.

public PDO|null $pdo = null

$report

Array containing information about basic SQL connection parameters.

public array<string, string> $report = ['LastMessage' => 'Please extend']

$result

SQLLink result.

public PDOStatement $result

$resultArray

Array containing the results of the last SQL command.

public array<string, mixed> $resultArray = []

SQL Handle.

public resource $sqlLink

$status

Connected state ?

public bool $status = false

$tableName

Name of the currently processed table.

public string $tableName = ''

$tableStructure

Array containing the structure of the SQL table.

public array<string, string> $tableStructure = []

$connectAllreadyUP

Indicator of connection settings - SET commands have been executed.

protected bool $connectAllreadyUP = false

$errorNumber

Last error number.

protected int $errorNumber

$_instance

Saves object instance (singleton...).

private static mixed $_instance

$errorText

private string $errorText

Methods

__construct()

General database object.

public __construct([mixed $options = [] ]) : mixed
Parameters
$options : mixed = []

__destruct()

cleanup.

public __destruct() : mixed

__sleep()

Resets the last query when serializing.

public __sleep() : bool
Return values
bool

__wakeup()

public __wakeup() : void

addSlashes()

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

public addSlashes(string $text) : string

since version 0.1

Parameters
$text : string
Return values
string

arrayToSetQuery()

From the $data array, creates a fragment of the SQL query for WHERE (the key column $this->keyColumn is skipped if $key is false).

public arrayToSetQuery(array<string|int, mixed> $data[, bool $key = true ]) : string

since version 1.0

Parameters
$data : array<string|int, mixed>
$key : bool = true
Return values
string

close()

Ukončí připojení k databázi.

public close() : mixed

connect()

Connect to the database.

public connect() : void

getColumnComma()

Returns quotes for column names.

public getColumnComma() : string

since version 1.2

Return values
string

getInsertID()

ID returned after INSERT.

public getInsertID() : int
Return values
int

getLastError()

Returns the SQL error message.

public getLastError() : string
Return values
string

getlastInsertID()

Poslední genrované ID.

public getlastInsertID([null|mixed $column = null ]) : int
Parameters
$column : null|mixed = null
Return values
int

ID

getLastQuery()

Last executed query.

public getLastQuery() : int
Return values
int

number of rows

getNumRows()

Returns the number of rows returned or affected by the last SQL query.

public getNumRows() : int
Return values
int

number of rows

isConnected()

Return connect status.

public isConnected() : bool
Return values
bool

logSqlError()

Do when SQL error occurs.

public logSqlError([bool $ignoreErrors = false ]) : mixed
Parameters
$ignoreErrors : bool = false

ping()

Test the possibility of connecting to the SQL server.

public ping([bool $succes = false ]) : bool
Parameters
$succes : bool = false
Return values
bool

sanitizeQuery()

Removes "dangerous" characters from the SQL query.

public sanitizeQuery(string $queryRaw) : string
Parameters
$queryRaw : string

SQL Query

Return values
string

SQL Query

selectDB()

Změní aktuálně použitou databázi.

public selectDB([null|mixed $dbName = null ]) : bool
Parameters
$dbName : null|mixed = null
Return values
bool

setKeyColumn()

Set KeyColumn used for PGSQL indertid.

public setKeyColumn([string $column = null ]) : bool
Parameters
$column : string = null
Return values
bool

Operation success

setTable()

public setTable(string $tableName) : void
Parameters
$tableName : string

setTableName()

Set Table we work with.

public setTableName(string $tablename) : bool
Parameters
$tablename : string
Return values
bool

setUp()

SetUp Object to be ready for connect.

public setUp([array<string|int, mixed> $options = [] ]) : bool
Parameters
$options : array<string|int, mixed> = []

Object Options (company,url,user,password,evidence, prefix,defaultUrlParams,debug)

Return values
bool

singleton()

Pri vytvareni objektu pomoci funkce singleton (ma stejne parametry, jako konstruktor) se bude v ramci behu programu pouzivat pouze jedna jeho instance (ta prvni).

public static singleton([mixed $options = [] ]) : mixed
Parameters
$options : mixed = []
Tags
see
http://docs.php.net/en/language.oop5.patterns.html

Dokumentace a priklad


        
On this page

Search results