CaMykS  1.0-20231201
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Database_connection Class Reference

Interface object with the database driver and connection. More...

Public Member Functions

 __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 ()
 

Static Public Member Functions

static get_availableDriverList ()
 

Private Attributes

 $connection
 Connection with the driver and the database. More...
 
 $dbName
 Database name. More...
 
 $statistics
 Statistics to record. More...
 
 $reportStats
 Method to report statistics. More...
 
 $queries
 List of executed queries. More...
 
 $reportQueries
 Method to report queries. More...
 

Detailed Description

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
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.

Constructor & Destructor Documentation

◆ __construct()

Database_connection::__construct (   $host = 'localhost',
  $login = 'root',
  $pwd = '',
  $driver = '' 
)

Member Function Documentation

◆ select()

Database_connection::select (   $name)

Select database.

Parameters
string$name
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
string$name
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
string$name
Returns
boolean

◆ database_dump()

Database_connection::database_dump (   $file = false)

Dump database.

Parameters
mixed$file
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
string$resName
Returns
integer

◆ get_queryDataLine()

Database_connection::get_queryDataLine (   $resName = 'defaultRes')

Return next query data line.

Parameters
string$resName
Returns
array

◆ get_queryNumDataLine()

Database_connection::get_queryNumDataLine (   $resName = 'defaultRes')

Return next query data line with numeric index.

Parameters
string$resName
Returns
array

◆ get_queryError()

Database_connection::get_queryError (   $resName = 'defaultRes')

Return latest query error.

Parameters
string$resName
Returns
string

◆ get_queryAffectedRows()

Database_connection::get_queryAffectedRows (   $resName = 'defaultRes')

Return latest query affected rows.

Parameters
string$resName
Returns
integer

◆ get_queryFieldCount()

Database_connection::get_queryFieldCount (   $resName = 'defaultRes')

Return latest query field count.

Parameters
string$resName
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
string$resName
Returns
boolean result

◆ escape_string()

Database_connection::escape_string (   $string = '')

Return escaped string.

Parameters
string$string
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 ( )

Alias to close.

See also
close()
Returns
void
Deprecated:
Use close() instead.

Member Data Documentation

◆ $connection

Object Database_connection::$connection
private

Connection with the driver and the database.

◆ $dbName

string Database_connection::$dbName
private

Database name.

◆ $statistics

array Database_connection::$statistics
private

Statistics to record.

◆ $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: