Class ilance_mysql

Description

MySQL database class to perform the majority of database related functions in ILance

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.database_mysql.inc.php (line 29)

ilance_database
   |
   --ilance_mysql
Variable Summary
$functions $functions
$types $types
Method Summary
ilance_mysql ilance_mysql (object ilance &$registry, [integer $cachetimeout = 1], [bool $cachetodatabase = true])
nothing affected_rows ()
nothing close ()
boolean db_connect ()
nothing errno ()
nothing error ()
nothing escape_string ([string $query = ''])
nothing fetch_array (string &$query, [string $type = DB_BOTH])
nothing fetch_assoc (string &$query, [string $type = DB_ASSOC])
nothing fetch_field ([string $tbl = ''], [string $condition = ''], [string $field = ''], [bool $limit = ''])
nothing fetch_object (string &$query)
nothing fetch_row (string &$query, [string $type = DB_NUM])
void field_name ([ $query = ''])
Returns free_result ([string $res = ''])
nothing insert_id ()
void num_fields ([ $query = ''])
nothing num_rows ([string $query = ''])
nothing query ([string $string = ''], [bool $hideerrors = 0], [string $enablecache = null], [string $script = ''], [string $line = ''], [ $buffered = true], [ $errorexempt = array()])
nothing query_fetch ([string $string = ''], [bool $hideerrors = 0], [string $enablecache = null], [string $script = ''], [string $line = ''])
nothing select_db_wrapper ([string $database = ''], [object database $link = null])
Variables
$functions $functions = array(
'select_db' => 'mysql_select_db',
'pconnect' => 'mysql_pconnect',
'connect' => 'mysql_connect',
'query' => 'mysql_query',
'query_unbuffered' => 'mysql_unbuffered_query',
'fetch_row' => 'mysql_fetch_row',
'fetch_object' => 'mysql_fetch_object',
'fetch_array' => 'mysql_fetch_array',
'fetch_field' => 'mysql_fetch_field',
'free_result' => 'mysql_free_result',
'data_seek' => 'mysql_data_seek',
'error' => 'mysql_error',
'errno' => 'mysql_errno',
'affected_rows' => 'mysql_affected_rows',
'num_rows' => 'mysql_num_rows',
'num_fields' => 'mysql_num_fields',
'field_name' => 'mysql_field_name',
'insert_id' => 'mysql_insert_id',
'list_tables' => 'mysql_list_tables',
'list_fields' => 'mysql_list_fields',
'escape_string' => 'mysql_escape_string',
'real_escape_string' => 'mysql_real_escape_string',
'close' => 'mysql_close',
'client_encoding' => 'mysql_client_encoding',
'create_db' => 'mysql_create_db',
'ping' => 'mysql_ping',
'free_result' => 'mysql_free_result'
)
(line 47)

MySQL Database Interface Functions

$types $types = array(
DB_NUM => MYSQL_NUM,
DB_ASSOC => MYSQL_ASSOC,
DB_BOTH => MYSQL_BOTH
)
(line 36)

MySQL Database Array Resource Types

Inherited Variables

Inherited from ilance_database

ilance_database::$connection_link
ilance_database::$connection_read
ilance_database::$connection_write
ilance_database::$database
ilance_database::$debug
ilance_database::$email_reporting
ilance_database::$end
ilance_database::$errno
ilance_database::$error
ilance_database::$error_reporting
ilance_database::$explain
ilance_database::$formatted
ilance_database::$multiserver
ilance_database::$querylist
ilance_database::$query_count
ilance_database::$registry
ilance_database::$start
ilance_database::$totaltime
ilance_database::$ttquery
Methods
Constructor ilance_mysql (line 84)

Constructor

ilance_mysql ilance_mysql (object ilance &$registry, [integer $cachetimeout = 1], [bool $cachetodatabase = true])
  • object ilance &$registry: registry object
  • integer $cachetimeout: cache time out
  • bool $cachetodatabase: cache results to database within cache table?
affected_rows (line 275)

Function to fetch the total number of affected rows for the connection

nothing affected_rows ()
close (line 356)

Function to close the database connection

nothing close ()
db_connect (line 99)

Connect to the database and return the connection link resource

Connects to a database server and physically returns the connection link identifier

boolean db_connect ()
errno (line 377)

Function to mimic database error number handling

nothing errno ()
error (line 366)

Function to mimic database error handling

nothing error ()
escape_string (line 390)

Function to execute xxxx_real_escape_string()

nothing escape_string ([string $query = ''])
  • string $query: sql code
fetch_array (line 227)

Function to perform a database fetch array

nothing fetch_array (string &$query, [string $type = DB_BOTH])
  • string &$query: sql code
  • string $type: sql result type
fetch_assoc (line 252)

Function to perform a database fetch associative array

nothing fetch_assoc (string &$query, [string $type = DB_ASSOC])
  • string &$query: sql code
  • string $type: sql result type
fetch_field (line 290)

Function to fetch a field value result from a table

nothing fetch_field ([string $tbl = ''], [string $condition = ''], [string $field = ''], [bool $limit = ''])
  • string $tbl: table name
  • string $condition: sql condition code
  • string $field: field name
  • bool $limit: (optional) cache results to file?
fetch_object (line 239)

Function to perform a database fetch object

nothing fetch_object (string &$query)
  • string &$query: sql code
fetch_row (line 265)

Function to perform a database fetch row

nothing fetch_row (string &$query, [string $type = DB_NUM])
  • string &$query: sql code
  • string $type: sql result type
field_name (line 336)
void field_name ([ $query = ''])
  • $query
free_result (line 402)

Function to frees the memory associated with a result

  • return: TRUE on success or FALSE on failure.
Returns free_result ([string $res = ''])
  • string $res: sql result
insert_id (line 346)

Function to fetch the last insert id for the database connection

nothing insert_id ()
num_fields (line 324)
void num_fields ([ $query = ''])
  • $query
num_rows (line 312)

Function to perform a database num rows

nothing num_rows ([string $query = ''])
  • string $query: sql code
query (line 148)

Function to perform a database specific query

nothing query ([string $string = ''], [bool $hideerrors = 0], [string $enablecache = null], [string $script = ''], [string $line = ''], [ $buffered = true], [ $errorexempt = array()])
  • string $string: sql code
  • bool $hideerrors: hide database errors? default false
  • string $enablecache: enable cache? (will use defined cache engine selected within connect.php)
  • string $script: script filename
  • string $line: script line number
  • $buffered
  • $errorexempt
query_fetch (line 197)

Function to perform a database specific query and immediately returns the associated array/results

nothing query_fetch ([string $string = ''], [bool $hideerrors = 0], [string $enablecache = null], [string $script = ''], [string $line = ''])
  • string $string: sql code
  • bool $hideerrors: hide database errors? default false
  • string $enablecache: enable cache? (will use defined cache engine selected within connect.php)
  • string $script: script filename
  • string $line: script line number
select_db_wrapper (line 132)

Function to select the database with an associated mysql link identifier

nothing select_db_wrapper ([string $database = ''], [object database $link = null])
  • string $database: database name
  • object database $link: link

Inherited Methods

Inherited From ilance_database

ilance_database::ilance_database()
ilance_database::add()
ilance_database::add_field_if_not_exist()
ilance_database::change_field_if_not_exist()
ilance_database::connect()
ilance_database::dberror()
ilance_database::explain_query()
ilance_database::field_exists()
ilance_database::format()
ilance_database::gettime()
ilance_database::query_cache()
ilance_database::remove()
ilance_database::select_db()
ilance_database::stop()
ilance_database::table_exists()
ilance_database::timer()

Documentation generated on Mon, 08 Aug 2011 17:40:53 +0200 by phpDocumentor 1.4.1