class dbal_mysqli extends dbal
MySQLi Database Abstraction Layer mysqli-extension has to be compiled with: MySQL 4.1+ or MySQL 5.0+
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 | |
| $connect_error |
Methods
|
dbal()
Constructor |
from dbal | |
|
sql_return_on_error($fail = false)
return on error or display error message |
from dbal | |
|
sql_num_queries($cached = false)
Return number of sql queries and cached sql queries used |
from dbal | |
|
sql_add_num_queries($cached = false)
Add to query count |
from dbal | |
|
sql_close()
DBAL garbage collection, close sql connection |
from dbal | |
|
sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query Doing some validation here. |
from dbal | |
|
sql_fetchrowset($query_id = false)
Fetch all rows |
from dbal | |
|
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) |
from dbal | |
| string |
sql_like_expression(string $expression)
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way |
from dbal |
| bool |
sql_buffer_nested_transactions()
Returns whether results of a query need to be buffered to run a transaction while iterating over them. |
from dbal |
|
sql_transaction($status = 'begin')
SQL Transaction |
from dbal | |
|
sql_build_array($query, $assoc_ary = false)
Build sql statement from array for insert/update/select statements |
from dbal | |
|
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 |
from dbal | |
|
sql_bit_and(string $column_name, int $bit, string $compare = '')
Run binary AND operator on DB column. |
from dbal | |
|
sql_bit_or(string $column_name, int $bit, string $compare = '')
Run binary OR operator on DB column. |
from dbal | |
| string |
sql_lower_text(string $column_name)
Run LOWER() on DB column of type text (i.e. |
from dbal |
| bool |
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement. |
from dbal |
|
_sql_validate_value($var)
Function for validating values |
from dbal | |
|
sql_build_query($query, $array)
Build sql statement from array for select and select distinct statements |
from dbal | |
|
sql_error($sql = '')
display sql error page |
from dbal | |
|
sql_report($mode, $query = '')
Explain queries |
from dbal | |
| 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. |
|
|
sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
Connect to server |
||
| string |
sql_server_info($raw = false, $use_cache = true)
Version information about used database |
|
|
_sql_transaction($status = 'begin')
SQL Transaction |
||
|
sql_query($query = '', $cache_ttl)
Base query method |
||
|
_sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query |
||
|
sql_affectedrows()
Return number of affected rows |
||
|
sql_fetchrow($query_id = false)
Fetch current row |
||
|
sql_nextid()
Get last inserted id after insert statement |
||
|
sql_freeresult($query_id = false)
Free sql result |
||
|
sql_escape($msg)
Escape string used in sql query |
||
| array |
get_table_status(string $table_name)
Gets some information about the specified table. |
|
|
_sql_like_expression($expression)
Build LIKE expression |
||
|
_sql_custom_build($stage, $data)
Build db-specific query data |
||
|
_sql_error()
return sql error array |
||
|
_sql_close()
Close sql connection |
||
|
_sql_report($mode, $query = '')
Build db-specific report |
Details
in dbal at line 76
public
dbal()
Constructor
in dbal at line 96
public
sql_return_on_error($fail = false)
return on error or display error message
in dbal at line 107
public
sql_num_queries($cached = false)
Return number of sql queries and cached sql queries used
in dbal at line 115
public
sql_add_num_queries($cached = false)
Add to query count
in dbal at line 125
public
sql_close()
DBAL garbage collection, close sql connection
in dbal at line 159
public
sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query Doing some validation here.
in dbal at line 176
public
sql_fetchrowset($query_id = false)
Fetch all rows
at line 272
public
sql_rowseek($rownum, $query_id)
Seek to given row number rownum is zero-based
in dbal 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)
in dbal 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
in dbal 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.
in dbal at line 301
public
sql_transaction($status = 'begin')
SQL Transaction
in dbal 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
in dbal 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
in dbal 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}"
in dbal 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}"
in dbal 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).
in dbal at line 524
public bool
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement.
in dbal at line 577
public
_sql_validate_value($var)
Function for validating values
in dbal 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
in dbal at line 701
public
sql_error($sql = '')
display sql error page
in dbal at line 771
public
sql_report($mode, $query = '')
Explain queries
at line 335
public string
get_estimated_row_count(string $table_name)
Gets the estimated number of rows in a specified table.
at line 363
public string
get_row_count(string $table_name)
Gets the exact number of rows in a specified table.
at line 35
public
sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
Connect to server
at line 112
public string
sql_server_info($raw = false, $use_cache = true)
Version information about used database
at line 137
public
_sql_transaction($status = 'begin')
SQL Transaction
at line 170
public
sql_query($query = '', $cache_ttl)
Base query method
at line 218
public
_sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query
at line 237
public
sql_affectedrows()
Return number of affected rows
at line 245
public
sql_fetchrow($query_id = false)
Fetch current row
at line 292
public
sql_nextid()
Get last inserted id after insert statement
at line 300
public
sql_freeresult($query_id = false)
Free sql result
at line 320
public
sql_escape($msg)
Escape string used in sql query
at line 384
public array
get_table_status(string $table_name)
Gets some information about the specified table.
at line 399
public
_sql_like_expression($expression)
Build LIKE expression
at line 408
public
_sql_custom_build($stage, $data)
Build db-specific query data
at line 424
public
_sql_error()
return sql error array
at line 455
public
_sql_close()
Close sql connection
at line 464
public
_sql_report($mode, $query = '')
Build db-specific report