class dbal
Database Abstraction Layer
Properties
| $db_connect_id | ||
| $query_result | ||
| $return_on_error | ||
| $transaction | ||
| $sql_time | ||
| $num_queries | ||
| $open_queries | ||
| $curtime | ||
| $query_hold | ||
| $html_hold | ||
| $sql_report | ||
| $persistency | ||
| $user | ||
| $server | ||
| $dbname | ||
| $sql_error_triggered | ||
| $sql_error_sql | ||
| $sql_error_returned | ||
| $transactions | ||
| $multi_insert | ||
| $sql_layer | Current sql layer | |
| $any_char | Wildcards for matching any (%) or exactly one (_) character within LIKE expressions | |
| $one_char | ||
| $sql_server_version | Exact version of the DBAL, directly queried |
Methods
|
dbal()
Constructor |
||
|
sql_return_on_error($fail = false)
return on error or display error message |
||
|
sql_num_queries($cached = false)
Return number of sql queries and cached sql queries used |
||
|
sql_add_num_queries($cached = false)
Add to query count |
||
|
sql_close()
DBAL garbage collection, close sql connection |
||
|
sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query Doing some validation here. |
||
|
sql_fetchrowset($query_id = false)
Fetch all rows |
||
|
sql_rowseek($rownum, $query_id)
Seek to given row number rownum is zero-based |
||
|
sql_fetchfield($field, $rownum = false, $query_id = false)
Fetch field if rownum is false, the current row is used, else it is pointing to the row (zero-based) |
||
| string |
sql_like_expression(string $expression)
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way |
|
| bool |
sql_buffer_nested_transactions()
Returns whether results of a query need to be buffered to run a transaction while iterating over them. |
|
|
sql_transaction($status = 'begin')
SQL Transaction |
||
|
sql_build_array($query, $assoc_ary = false)
Build sql statement from array for insert/update/select statements |
||
|
sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
Build IN or NOT IN sql comparison string, uses <> or = on single element arrays to improve comparison speed |
||
|
sql_bit_and(string $column_name, int $bit, string $compare = '')
Run binary AND operator on DB column. |
||
|
sql_bit_or(string $column_name, int $bit, string $compare = '')
Run binary OR operator on DB column. |
||
| string |
sql_lower_text(string $column_name)
Run LOWER() on DB column of type text (i.e. |
|
| bool |
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement. |
|
|
_sql_validate_value($var)
Function for validating values |
||
|
sql_build_query($query, $array)
Build sql statement from array for select and select distinct statements |
||
|
sql_error($sql = '')
display sql error page |
||
|
sql_report($mode, $query = '')
Explain queries |
||
| string |
get_estimated_row_count(string $table_name)
Gets the estimated number of rows in a specified table. |
|
| string |
get_row_count(string $table_name)
Gets the exact number of rows in a specified table. |
Details
at line 76
public
dbal()
Constructor
at line 96
public
sql_return_on_error($fail = false)
return on error or display error message
at line 107
public
sql_num_queries($cached = false)
Return number of sql queries and cached sql queries used
at line 115
public
sql_add_num_queries($cached = false)
Add to query count
at line 125
public
sql_close()
DBAL garbage collection, close sql connection
at line 159
public
sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query Doing some validation here.
at line 176
public
sql_fetchrowset($query_id = false)
Fetch all rows
at line 201
public
sql_rowseek($rownum, $query_id)
Seek to given row number rownum is zero-based
at line 244
public
sql_fetchfield($field, $rownum = false, $query_id = false)
Fetch field if rownum is false, the current row is used, else it is pointing to the row (zero-based)
at line 279
public string
sql_like_expression(string $expression)
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way
at line 292
public bool
sql_buffer_nested_transactions()
Returns whether results of a query need to be buffered to run a transaction while iterating over them.
at line 301
public
sql_transaction($status = 'begin')
SQL Transaction
at line 370
public
sql_build_array($query, $assoc_ary = false)
Build sql statement from array for insert/update/select statements
Idea for this from Ikonboard Possible query values: INSERT, INSERT_SELECT, UPDATE, SELECT
at line 425
public
sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
Build IN or NOT IN sql comparison string, uses <> or = on single element arrays to improve comparison speed
at line 475
public
sql_bit_and(string $column_name, int $bit, string $compare = '')
Run binary AND operator on DB column.
Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}"
at line 493
public
sql_bit_or(string $column_name, int $bit, string $compare = '')
Run binary OR operator on DB column.
Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}"
at line 510
public string
sql_lower_text(string $column_name)
Run LOWER() on DB column of type text (i.e.
neither varchar nor char).
at line 524
public bool
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement.
at line 577
public
_sql_validate_value($var)
Function for validating values
at line 598
public
sql_build_query($query, $array)
Build sql statement from array for select and select distinct statements
Possible query values: SELECT, SELECT_DISTINCT
at line 701
public
sql_error($sql = '')
display sql error page
at line 771
public
sql_report($mode, $query = '')
Explain queries
at line 969
public string
get_estimated_row_count(string $table_name)
Gets the estimated number of rows in a specified table.
at line 983
public string
get_row_count(string $table_name)
Gets the exact number of rows in a specified table.