CaMykS  1.0-20181201
 All Classes Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
Database_connection Class Reference

Public Member Functions

 Database_connection ($host='localhost', $login='root', $pwd='', $driver='')
 
 connect ()
 
 select ($name)
 
 kill ()
 
 is_active ()
 
 execute_query ($sql='')
 
 get_queryGeneratedId ()
 
 get_queryDataLine ()
 
 get_queryError ()
 
 get_queryAffectedRows ()
 
 database_create ($name, $charset='utf8')
 
 database_exists ($name)
 
 database_dump ($file=false)
 
 database_getSize ()
 
 __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')
 
 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 ()
 

Public Attributes

 $host
 
 $login
 
 $pwd
 
 $name
 
 $connection
 Connection with the driver and the database. More...
 
 $active
 

Private Attributes

 $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

Database_connection class.

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Constructor & Destructor Documentation

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

Member Function Documentation

Database_connection::check_status (   $name)

Check connection status.

Parameters
string$name
Returns
array
Database_connection::close ( )

Close database connnection.

Returns
boolean
Database_connection::close_ressource (   $resName = 'defaultRes')

Close ressource.

Parameters
string$resName
Returns
boolean result
Database_connection::connect ( )
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
Database_connection::Database_connection (   $host = 'localhost',
  $login = 'root',
  $pwd = '',
  $driver = '' 
)
Database_connection::database_create (   $name,
  $charset = 'utf8' 
)
Database_connection::database_create (   $name,
  $charset = 'utf8' 
)

Create a database.

Parameters
string$name
string$charset
Returns
boolean
Database_connection::database_dump (   $file = false)
Database_connection::database_dump (   $file = false)

Dump database.

Parameters
mixed$file
Returns
mixed
Database_connection::database_exists (   $name)
Database_connection::database_exists (   $name)

Check if a database exits

Parameters
string$name
Returns
boolean
Database_connection::database_getSize ( )

Return database size.

Returns
integer
Database_connection::database_getSize ( )
Database_connection::database_getSummary ( )

Return database summary.

Returns
integer
Database_connection::escape_string (   $string = '')

Return escaped string.

Parameters
string$string
Returns
string
Database_connection::execute_query (   $sql = '')
Database_connection::execute_query (   $sql = '',
  $resName = 'defaultRes' 
)

Execute query.

Parameters
string$sql
string$resName
Returns
boolean success
static Database_connection::get_availableDriverList ( )
static

Return available driver list.
Method is static to be called without having a working database connection.

Returns
array
Database_connection::get_insertExtra ( )
Database_connection::get_queryAffectedRows ( )
Database_connection::get_queryAffectedRows (   $resName = 'defaultRes')

Return latest query affected rows.

Parameters
string$resName
Returns
integer
Database_connection::get_queryDataLine ( )
Database_connection::get_queryDataLine (   $resName = 'defaultRes')

Return next query data line.

Parameters
string$resName
Returns
array
Database_connection::get_queryError ( )
Database_connection::get_queryError (   $resName = 'defaultRes')

Return latest query error.

Parameters
string$resName
Returns
string
Database_connection::get_queryFieldCount (   $resName = 'defaultRes')

Return latest query field count.

Parameters
string$resName
Returns
integer
Database_connection::get_queryFieldType (   $fIndex = 0,
  $resName = 'defaultRes' 
)

Return latest query field type.

Parameters
integer$fIndex
string$resName
Returns
string
Database_connection::get_queryGeneratedId ( )
Database_connection::get_queryGeneratedId (   $resName = 'defaultRes')

Return id generated by last query.

Parameters
string$resName
Returns
integer
Database_connection::get_queryNumDataLine (   $resName = 'defaultRes')

Return next query data line with numeric index.

Parameters
string$resName
Returns
array
Database_connection::get_serverVersion ( )

Return database engine version.

Returns
string
Database_connection::get_statsQueriesResult ( )

Return stats queries result.

Returns
array
Database_connection::get_statsReportResult ( )

Return stats report result.

Returns
array
Database_connection::get_tableList ( )

Return database table list.

Returns
array
Database_connection::is_active ( )
Database_connection::is_active ( )

Check if connection is active.

Returns
boolean
Database_connection::kill ( )
Database_connection::kill ( )

Alias to close.

See also
close()
Returns
void
Deprecated:
Use close() instead.
Database_connection::select (   $name)
Database_connection::select (   $name)

Select database.

Parameters
string$name
Returns
boolean

Member Data Documentation

Database_connection::$active
Object Database_connection::$connection

Connection with the driver and the database.

string Database_connection::$dbName
private

Database name.

Database_connection::$host
Database_connection::$login
Database_connection::$name
Database_connection::$pwd
array Database_connection::$queries
private

List of executed queries.

string Database_connection::$reportQueries
private

Method to report queries.

string Database_connection::$reportStats
private

Method to report statistics.

array Database_connection::$statistics
private

Statistics to record.


The documentation for this class was generated from the following files: