Class ezSQLcore

Description

ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).

Located in /shared/ez_sql_core.php (line 14)


	
			
Direct descendents
Class Description
ezSQL_postgresql ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)
ezSQL_codeigniter ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)
ezSQL_mssql ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.
ezSQL_pdo ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)
ezSQL_sybase ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.
ezSQL_oracle8_9 ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)
ezSQL_oracleTNS ezSQL Database specific class with TNS connection Desc..: Oracle TNS component (part of ezSQL databse abstraction library)
ezSQL_mysql ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)
Class Constant Summary
ARRAY_A = true
ARRAY_N = true
EZSQL_VERSION = '3.05'
OBJECT = true
Variable Summary
boolean $cache_dir
boolean $cache_inserts
boolean $cache_queries
integer $cache_timeout
object Default $col_info
boolean $connected
object Default $dbh
boolean $debug_all
boolean $do_profile
object Default $last_error
object Default $last_query
object Default $last_result
boolean $sql_log_file
array $timers
boolean $trace
array $trace_log
boolean $use_disk_cache
boolean $use_trace_log
boolean $vardump_called
Method Summary
int affectedRows ()
string debug ([boolean $print_to_screen = true])
string donation ()
string dumpvar (variant $mixed)
ezSQLcore __construct ()
void flush ()
boolean getShowErrors ()
object get_cache (object $query)
array get_col ([object $query = null], [type $x = 0])
type get_col_info ([type $info_type = 'name'], [type $col_offset = -1])
array get_results ([object $query = null], [boolean $output = self::OBJECT])
type get_row ([object $query = null], [bolean $output = self::OBJECT], [int $y = 0])
variant get_var ([$query $query = null], [$x $x = 0], [$y $y = 0])
void hide_errors ()
boolean isConnected ()
void register_error ($err_str $err_str)
void show_errors ()
void store_cache (object $query, boolean $is_insert)
float timer_elapsed (string $timer_name)
float timer_get_cur ()
void timer_start (string $timer_name)
void timer_update_global (string $timer_name)
string vardump ([variant $mixed = ''])
Variables
int $affectedRows = 0 (line 190)

Contains the number of affected rows of a query

  • var: Default is 0
  • access: protected
boolean $cache_dir = false (line 100)

Using the cache directory

  • var: Default is false
  • access: public
boolean $cache_inserts = false (line 112)

Insert queries into the cache

  • var: Default is false
  • access: public
boolean $cache_queries = false (line 106)

Caching queries

  • var: Default is false
  • access: public
integer $cache_timeout = 24 (line 124)

The cache timeout in hours

  • var: Default is 24
  • access: public
array $captured_errors = array() (line 94)

Captured errors

  • var: Default is empty array
  • access: public
object Default $col_info = null (line 88)

The last column info

  • var: is null
  • access: public
boolean $connected = false (line 184)

Whether the database connection is established, or not

  • var: Default is false
  • access: protected
object Default $dbh = null (line 178)

The database connection object

  • var: is null
  • access: public
int $db_connect_time = 0 (line 142)

The time it took to establish a connection

  • var: Default is 0
  • access: public
boolean $debug_all = false (line 46)

same as $trace

  • var: Default is false
  • access: public
mixed $debug_called = false (line 52)

Debug is called

  • public: boolean Default is false
  • access: public
boolean $debug_echo_is_on = true (line 198)

== TJH == default now needed for echo of debug function

The default for returning errors, turn it of, if you are not interested in seeing your database errors

  • var: Default is true
  • access: public
boolean $do_profile = false (line 166)

Using profiling

  • var: Default is false
  • access: public
boolean $from_disk_cache = false (line 210)

Get data from disk cache

  • var: Default is false
  • access: public
object Default $last_error = null (line 82)

The last error object

  • var: is null
  • access: public
object Default $last_query = null (line 76)

The last query object

  • var: is null
  • access: public
object Default $last_result = null (line 204)

The last query result

  • var: is null
  • access: public
int $num_queries = 0 (line 70)

Number of queries

  • var: Default is 0
  • access: public
array $profile_times = array() (line 172)

Array for storing profiling times

  • var: Default is empty array
  • access: public
boolean $sql_log_file = false (line 160)

Use a SQL log file

  • var: Default is false
  • access: public
array $timers = array() (line 130)

Timers

  • var: Default is empty array
  • access: public
int $total_query_time = 0 (line 136)

The total query time

  • var: Default is 0
  • access: public
boolean $trace = false (line 40)

same as $debug_all

  • var: Default is false
  • access: public
array $trace_log = array() (line 148)

The trace log

  • var: Default is empty array
  • access: public
boolean $use_disk_cache = false (line 118)

Using disk cache

  • var: Default is false
  • access: public
boolean $use_trace_log = false (line 154)

Use the trace log

  • var: Default is false
  • access: public
boolean $vardump_called = false (line 58)

Vardump called

  • var: Default is false
  • access: public
Methods
affectedRows (line 717)

Returns the affected rows of a query

  • access: public
int affectedRows ()
debug (line 545)

Displays the last query string that was sent to the database & a table listing results (if there were any).

(Abstracted into a seperate files to save server overhead).

  • return: The HTML result
  • access: public
string debug ([boolean $print_to_screen = true])
  • boolean $print_to_screen: Default is true
donation (line 635)

Naughty little function to ask for some remuniration!

  • return: An HTML string with payment information
  • access: public
string donation ()
dumpvar (line 533)

An alias for vardump method

  • return: Returns HTML result
  • access: public
string dumpvar (variant $mixed)
  • variant $mixed: Default is empty String
Constructor __construct (line 221)

Constructor of ezSQL

  • access: public
ezSQLcore __construct ()

Redefined in descendants as:
flush (line 259)

Kill cached query results

  • access: public
void flush ()
getShowErrors (line 708)

Returns the current show error state

  • access: public
boolean getShowErrors ()
get_cache (line 460)

Get the query cache of a query

  • access: public
object get_cache (object $query)
  • object $query
get_col (line 336)

Function to get 1 column from the cached result set based in X index see docs for usage and info

  • access: public
array get_col ([object $query = null], [type $x = 0])
  • object $query: Default is null
  • type $x: Default is 0
get_col_info (line 406)

Function to get column meta data info pertaining to the last query See docs for more info and usage

  • access: public
type get_col_info ([type $info_type = 'name'], [type $col_offset = -1])
  • type $info_type
  • type $col_offset
get_results (line 362)

Return the the query as a result set - see docs for more details

  • access: public
array get_results ([object $query = null], [boolean $output = self::OBJECT])
  • object $query: Default is null
  • boolean $output: Default is the OBJECT constant
get_row (line 301)

Get one row from the DB - see docs for more detail

  • access: public
type get_row ([object $query = null], [bolean $output = self::OBJECT], [int $y = 0])
  • object $query: Default is null
  • bolean $output: Default is the OBJECT constant
  • int $y: Default is 0
get_var (line 275)

Get one variable from the DB - see docs for more detail

  • return: The value of a variable
  • access: public
variant get_var ([$query $query = null], [$x $x = 0], [$y $y = 0])
  • $query $query: object A query object, default is null
  • $x $x: int Default is 0
  • $y $y: int Default is 0
hide_errors (line 252)

Turn error handling off

  • access: public
void hide_errors ()
isConnected (line 699)

Returns, whether a database connection is established, or not

  • access: public
boolean isConnected ()
register_error (line 230)

Print SQL/DB error - over-ridden by specific DB class

  • access: public
void register_error ($err_str $err_str)
  • $err_str $err_str: string
show_errors (line 245)

Turn error handling on, by default error handling is on

  • access: public
void show_errors ()
store_cache (line 430)

Store the cache

  • access: public
void store_cache (object $query, boolean $is_insert)
  • object $query
  • boolean $is_insert
timer_elapsed (line 673)

Returns the elapsed time of the given timer by name

  • access: public
float timer_elapsed (string $timer_name)
  • string $timer_name
timer_get_cur (line 653)

Get current time

  • access: public
float timer_get_cur ()
timer_start (line 663)

Start a timer by name

  • access: public
void timer_start (string $timer_name)
  • string $timer_name
timer_update_global (line 682)

Update the global timer with an existing timer

  • access: public
void timer_update_global (string $timer_name)
  • string $timer_name
vardump (line 493)

Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array

  • return: Returns HTML result
  • access: public
string vardump ([variant $mixed = ''])
  • variant $mixed: Default is empty String
Class Constants
ARRAY_A = true (line 29)

Constant boolean

ARRAY_N = true (line 34)

Constant boolean

EZSQL_VERSION = '3.05' (line 19)

Constant string ezSQL version information

OBJECT = true (line 24)

Constant boolean Object

Documentation generated on Mon, 26 Aug 2013 23:22:20 +0200 by phpDocumentor 1.4.4