interface driver_interface
Methods
string |
get_sql_layer()
Gets the name of the sql layer. |
|
string |
get_db_name()
Gets the name of the database. |
|
string |
get_any_char()
Wildcards for matching any (%) character within LIKE expressions |
|
string |
get_one_char()
Wildcards for matching exactly one (_) character within LIKE expressions |
|
int |
get_sql_time()
Gets the time spent into the queries |
|
mixed |
get_db_connect_id()
Gets the connect ID. |
|
bool |
get_sql_error_triggered()
Indicates if an error was triggered. |
|
string |
get_sql_error_sql()
Gets the last faulty query |
|
bool |
get_transaction()
Indicates if we are in a transaction. |
|
array |
get_sql_error_returned()
Gets the returned error. |
|
bool |
get_multi_insert()
Indicates if multiple insertion can be used |
|
set_multi_insert(bool $multi_insert)
Set if multiple insertion can be used |
||
string |
get_row_count(string $table_name)
Gets the exact number of rows in a specified table. |
|
string |
get_estimated_row_count(string $table_name)
Gets the estimated number of rows in a specified table. |
|
string |
sql_lower_text(string $column_name)
Run LOWER() on DB column of type text (i.e. |
|
mixed |
sql_error(string $sql = '')
Display sql error page |
|
bool |
sql_buffer_nested_transactions()
Returns whether results of a query need to be buffered to run a transaction while iterating over them. |
|
string |
sql_bit_or(string $column_name, int $bit, string $compare = '')
Run binary OR operator on DB column. |
|
string |
sql_server_info(bool $raw = false, bool $use_cache = true)
Version information about used database |
|
null |
sql_return_on_error(bool $fail = false)
Return on error or display error message |
|
sql_build_array($query, $assoc_ary = array())
Build sql statement from an array |
||
sql_fetchrowset($query_id = false)
Fetch all rows |
||
sql_transaction($status = 'begin')
SQL Transaction |
||
sql_concatenate($expr1, $expr2)
Build a concatenated expression |
||
sql_case($condition, $action_true, $action_false = false)
Build a case expression |
||
sql_build_query($query, $array)
Build sql statement from array for select and select distinct statements |
||
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) |
||
sql_fetchrow($query_id = false)
Fetch current row |
||
string |
cast_expr_to_bigint(string $expression)
Returns SQL string to cast a string expression to an int. |
|
sql_nextid()
Get last inserted id after insert statement |
||
null |
sql_add_num_queries(bool $cached = false)
Add to query count |
|
sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query |
||
sql_query($query = '', $cache_ttl)
Base query method |
||
string |
cast_expr_to_string($expression)
Returns SQL string to cast an integer expression to a string. |
|
sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
Connect to server |
||
string |
sql_bit_and(string $column_name, int $bit, string $compare = '')
Run binary AND operator on DB column. |
|
sql_freeresult($query_id = false)
Free sql result |
||
sql_num_queries($cached = false)
Return number of sql queries and cached sql queries used |
||
bool |
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement. |
|
sql_affectedrows()
Return number of affected rows |
||
sql_close()
DBAL garbage collection, close SQL connection |
||
sql_rowseek($rownum, $query_id)
Seek to given row number |
||
sql_escape($msg)
Escape string used in sql query |
||
string |
sql_like_expression($expression)
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way |
|
string |
sql_not_like_expression($expression)
Correctly adjust NOT LIKE expression for special characters Some DBMS are handling them in a different way |
|
sql_report($mode, $query = '')
Explain queries |
||
string |
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 |
Details
at line 23
public string
get_sql_layer()
Gets the name of the sql layer.
at line 30
public string
get_db_name()
Gets the name of the database.
at line 37
public string
get_any_char()
Wildcards for matching any (%) character within LIKE expressions
at line 44
public string
get_one_char()
Wildcards for matching exactly one (_) character within LIKE expressions
at line 51
public int
get_sql_time()
Gets the time spent into the queries
at line 58
public mixed
get_db_connect_id()
Gets the connect ID.
at line 65
public bool
get_sql_error_triggered()
Indicates if an error was triggered.
at line 72
public string
get_sql_error_sql()
Gets the last faulty query
at line 79
public bool
get_transaction()
Indicates if we are in a transaction.
at line 86
public array
get_sql_error_returned()
Gets the returned error.
at line 93
public bool
get_multi_insert()
Indicates if multiple insertion can be used
at line 100
public
set_multi_insert(bool $multi_insert)
Set if multiple insertion can be used
at line 108
public string
get_row_count(string $table_name)
Gets the exact number of rows in a specified table.
at line 117
public string
get_estimated_row_count(string $table_name)
Gets the estimated number of rows in a specified table.
at line 125
public string
sql_lower_text(string $column_name)
Run LOWER() on DB column of type text (i.e.
neither varchar nor char).
at line 134
public mixed
sql_error(string $sql = '')
Display sql error page
at line 142
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 154
public string
sql_bit_or(string $column_name, int $bit, string $compare = '')
Run binary OR operator on DB column.
at line 163
public string
sql_server_info(bool $raw = false, bool $use_cache = true)
Version information about used database
at line 171
public null
sql_return_on_error(bool $fail = false)
Return on error or display error message
at line 181
public
sql_build_array($query, $assoc_ary = array())
Build sql statement from an array
at line 190
public
sql_fetchrowset($query_id = false)
Fetch all rows
at line 199
public
sql_transaction($status = 'begin')
SQL Transaction
at line 208
public
sql_concatenate($expr1, $expr2)
Build a concatenated expression
at line 222
public
sql_case($condition, $action_true, $action_false = false)
Build a case expression
Note: The two statements actiontrue and actionfalse must have the same data type (int, vchar, ...) in the database!
at line 242
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 257
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 267
public
sql_fetchrow($query_id = false)
Fetch current row
at line 275
public string
cast_expr_to_bigint(string $expression)
Returns SQL string to cast a string expression to an int.
at line 282
public
sql_nextid()
Get last inserted id after insert statement
at line 290
public null
sql_add_num_queries(bool $cached = false)
Add to query count
at line 302
public
sql_query_limit($query, $total, $offset, $cache_ttl)
Build LIMIT query
at line 312
public
sql_query($query = '', $cache_ttl)
Base query method
at line 320
public string
cast_expr_to_string($expression)
Returns SQL string to cast an integer expression to a string.
at line 334
public
sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
Connect to server
at line 347
public string
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 356
public
sql_freeresult($query_id = false)
Free sql result
at line 364
public
sql_num_queries($cached = false)
Return number of sql queries and cached sql queries used
at line 373
public bool
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement.
at line 381
public
sql_affectedrows()
Return number of affected rows
at line 389
public
sql_close()
DBAL garbage collection, close SQL connection
at line 401
public
sql_rowseek($rownum, $query_id)
Seek to given row number
at line 409
public
sql_escape($msg)
Escape string used in sql query
at line 419
public string
sql_like_expression($expression)
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way
at line 429
public string
sql_not_like_expression($expression)
Correctly adjust NOT LIKE expression for special characters Some DBMS are handling them in a different way
at line 439
public
sql_report($mode, $query = '')
Explain queries
at line 452
public string
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