Interface object with the database driver and connection.
More...
|
| __construct ($host='localhost', $login='root', $pwd='', $driver='') |
|
| select ($name) |
|
| close () |
|
| is_active () |
|
| check_status ($name) |
|
| get_statsReportResult () |
|
| get_statsQueriesResult () |
|
| get_serverVersion () |
|
| database_create ($name, $charset='utf8') |
|
| database_exists ($name) |
|
| database_dump ($file=false) |
|
| database_getSize () |
|
| database_getSummary () |
|
| get_tableList () |
|
| create_table ($name, $fields, $charset='utf8', $autoId=true, $primaryKeys=array('id')) |
|
| execute_query ($sql='', $resName='defaultRes') |
|
| execute_multiQueries ($sql='', $resName='defaultRes') |
|
| get_queryGeneratedId ($resName='defaultRes') |
|
| get_queryDataLine ($resName='defaultRes') |
|
| get_queryNumDataLine ($resName='defaultRes') |
|
| get_queryError ($resName='defaultRes') |
|
| get_queryAffectedRows ($resName='defaultRes') |
|
| get_queryFieldCount ($resName='defaultRes') |
|
| get_queryFieldType ($fIndex=0, $resName='defaultRes') |
|
| close_ressource ($resName='defaultRes') |
|
| escape_string ($string='') |
|
| get_insertExtra () |
|
| kill () |
|
Interface object with the database driver and connection.
Engine / Object Library
- Author
- CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Version
- 1.0.1
- Date
- Creation: Jun 2005
-
Modification: Sep 2020
- Copyright
- 2005 - 2020 CaMykS Team
- Note
- This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Database_connection class.
◆ __construct()
Database_connection::__construct |
( |
|
$host = 'localhost' , |
|
|
|
$login = 'root' , |
|
|
|
$pwd = '' , |
|
|
|
$driver = '' |
|
) |
| |
◆ select()
Database_connection::select |
( |
|
$name | ) |
|
Select database.
- Parameters
-
- Returns
- boolean
◆ close()
Database_connection::close |
( |
| ) |
|
Close database connnection.
- Returns
- boolean
◆ is_active()
Database_connection::is_active |
( |
| ) |
|
Check if connection is active.
- Returns
- boolean
◆ check_status()
Database_connection::check_status |
( |
|
$name | ) |
|
Check connection status.
- Parameters
-
- Returns
- array
◆ get_statsReportResult()
Database_connection::get_statsReportResult |
( |
| ) |
|
Return stats report result.
- Returns
- array
◆ get_statsQueriesResult()
Database_connection::get_statsQueriesResult |
( |
| ) |
|
Return stats queries result.
- Returns
- array
◆ get_serverVersion()
Database_connection::get_serverVersion |
( |
| ) |
|
Return database engine version.
- Returns
- string
◆ database_create()
Database_connection::database_create |
( |
|
$name, |
|
|
|
$charset = 'utf8' |
|
) |
| |
Create a database.
- Parameters
-
string | $name | |
string | $charset | |
- Returns
- boolean
◆ database_exists()
Database_connection::database_exists |
( |
|
$name | ) |
|
Check if a database exits
- Parameters
-
- Returns
- boolean
◆ database_dump()
Database_connection::database_dump |
( |
|
$file = false | ) |
|
Dump database.
- Parameters
-
- Returns
- mixed
◆ database_getSize()
Database_connection::database_getSize |
( |
| ) |
|
Return database size.
- Returns
- integer
◆ database_getSummary()
Database_connection::database_getSummary |
( |
| ) |
|
Return database summary.
- Returns
- integer
◆ get_tableList()
Database_connection::get_tableList |
( |
| ) |
|
Return database table list.
- Returns
- array
◆ create_table()
Database_connection::create_table |
( |
|
$name, |
|
|
|
$fields, |
|
|
|
$charset = 'utf8' , |
|
|
|
$autoId = true , |
|
|
|
$primaryKeys = array('id') |
|
) |
| |
Create a table in the database.
- Parameters
-
string | $name | |
array | $fields | |
string | $charset | |
boolean | $autoId | |
array | $primaryKeys | |
- Returns
- boolean success
◆ execute_query()
Database_connection::execute_query |
( |
|
$sql = '' , |
|
|
|
$resName = 'defaultRes' |
|
) |
| |
Execute query.
- Parameters
-
string | $sql | |
string | $resName | |
- Returns
- boolean success
◆ execute_multiQueries()
Database_connection::execute_multiQueries |
( |
|
$sql = '' , |
|
|
|
$resName = 'defaultRes' |
|
) |
| |
Execute multiple queries at once.
- Parameters
-
string | $sql | |
string | $resName | |
- Returns
- boolean success
◆ get_queryGeneratedId()
Database_connection::get_queryGeneratedId |
( |
|
$resName = 'defaultRes' | ) |
|
Return id generated by last query.
- Parameters
-
- Returns
- integer
◆ get_queryDataLine()
Database_connection::get_queryDataLine |
( |
|
$resName = 'defaultRes' | ) |
|
Return next query data line.
- Parameters
-
- Returns
- array
◆ get_queryNumDataLine()
Database_connection::get_queryNumDataLine |
( |
|
$resName = 'defaultRes' | ) |
|
Return next query data line with numeric index.
- Parameters
-
- Returns
- array
◆ get_queryError()
Database_connection::get_queryError |
( |
|
$resName = 'defaultRes' | ) |
|
Return latest query error.
- Parameters
-
- Returns
- string
◆ get_queryAffectedRows()
Database_connection::get_queryAffectedRows |
( |
|
$resName = 'defaultRes' | ) |
|
Return latest query affected rows.
- Parameters
-
- Returns
- integer
◆ get_queryFieldCount()
Database_connection::get_queryFieldCount |
( |
|
$resName = 'defaultRes' | ) |
|
Return latest query field count.
- Parameters
-
- Returns
- integer
◆ get_queryFieldType()
Database_connection::get_queryFieldType |
( |
|
$fIndex = 0 , |
|
|
|
$resName = 'defaultRes' |
|
) |
| |
Return latest query field type.
- Parameters
-
integer | $fIndex | |
string | $resName | |
- Returns
- string
◆ close_ressource()
Database_connection::close_ressource |
( |
|
$resName = 'defaultRes' | ) |
|
Close ressource.
- Parameters
-
- Returns
- boolean result
◆ escape_string()
Database_connection::escape_string |
( |
|
$string = '' | ) |
|
Return escaped string.
- Parameters
-
- Returns
- string
◆ get_insertExtra()
Database_connection::get_insertExtra |
( |
| ) |
|
◆ get_availableDriverList()
static Database_connection::get_availableDriverList |
( |
| ) |
|
|
static |
Return available driver list.
Method is static to be called without having a working database connection.
- Returns
- array
◆ kill()
Database_connection::kill |
( |
| ) |
|
◆ $connection
Object Database_connection::$connection |
|
private |
Connection with the driver and the database.
◆ $dbName
string Database_connection::$dbName |
|
private |
◆ $statistics
array Database_connection::$statistics |
|
private |
◆ $reportStats
string Database_connection::$reportStats |
|
private |
Method to report statistics.
◆ $queries
array Database_connection::$queries |
|
private |
List of executed queries.
◆ $reportQueries
string Database_connection::$reportQueries |
|
private |
Method to report queries.
The documentation for this class was generated from the following file: