Database independent query interface This is a wrapper for the PHP PDO
This is a wrapper for the PHP PDO.
package |
Framework |
---|---|
subpackage |
Database |
conn_configure(array $dsn, \PDO $dbh)
array
DSN for DB connections
\PDO
Connection handler
insert_id(string $table = '') : mixed
string
Table name (to find the incremented sequence)
mixed
ID or false on failure
sequence_name(string $table) : string
string
Table name
string
Translated sequence name
now(int $interval) : string
int
Optional interval (in seconds) to add/subtract
string
SQL function to use in query
ilike(string $column, string $value) : string
string
Field name
string
Search value
string
SQL statement to use in query
get_variable(string $varname, mixed $default = null) : mixed
string
Variable name
mixed
Default value if variable is not set
mixed
Variable value or default
dsn_string(array $dsn) : string
array
DSN parameters
string
DSN string
factory(string $db_dsnw, string $db_dsnr = '', bool $pconn = false) : \rcube_db
string
DSN for read/write operations
string
Optional DSN for read only operations
bool
Enables persistent connections
\rcube_db
Object instance
__construct(string $db_dsnw, string $db_dsnr = '', bool $pconn = false)
string
DSN for read/write operations
string
Optional DSN for read only operations
bool
Enables persistent connections
dsn_connect(array $dsn, string $mode)
array
DSN for DB connections
string
Connection mode (r|w)
conn_prepare(array $dsn)
array
DSN for DB connections
db_connect(string $mode, boolean $force = false)
string
Connection mode (r|w)
boolean
Enforce using the given mode
dsn_select($query)
set_debug(boolean $dbg = true)
boolean
True if SQL queries should be logged
debug(string $query)
string
SQL query
is_error(mixed $result = null) : string
mixed
Optional query result
string
Error message
is_connected() : boolean
boolean
True if in connected state
is_replicated() : bool
bool
Returns true if dsnw != dsnr
query() : \number
\number
Query handle identifier
limitquery() : \PDOStatement|bool
\PDOStatement|bool
Query handle or False on error
_query(string $query, int $offset, int $numrows, array $params) : \PDOStatement|bool
string
SQL query to execute
int
Offset for LIMIT statement
int
Number of rows for LIMIT statement
array
Values to be inserted in query
\PDOStatement|bool
Query handle or False on error
handle_error($query) : mixed
This by default logs the error but could be overriden by a driver implementation
mixed
Result to be stored and returned
affected_rows(mixed $result = null) : int
mixed
Optional query handle
int
Number of (matching) rows
num_rows(mixed $result = null) : mixed
deprecated |
This method shows very poor performance and should be avoided. |
---|---|
mixed
Optional query handle
mixed
Number of rows or false on failure
fetch_assoc(mixed $result = null) : mixed
mixed
Optional query handle
mixed
Array with col values or false on failure
fetch_array(mixed $result = null) : mixed
mixed
Optional query handle
mixed
Array with col values or false on failure
_fetch_row(mixed $result, int $mode) : mixed
mixed
Optional query handle
int
Fetch mode identifier
mixed
Array with col values or false on failure
set_limit(string $query, int $limit, int $offset) : string
string
SQL query
int
Number of rows
int
Offset
string
SQL query
list_tables() : array
array
List of all tables of the current database
list_cols(string $table) : array
string
Table name
array
List of table cols
quote(mixed $input, string $type = null) : string
mixed
Value to quote
string
Type of data (integer, bool, ident)
string
Quoted/converted string for use in query
escape(string $str) : string
string
A string to escape
string
Escaped string for use in a query
quoteIdentifier(string $str) : string
deprecated |
Replaced by rcube_db::quote_identifier |
---|---|
see | \rcube_db::quote_identifier |
string
Value to quote
string
Quoted string for use in query
escapeSimple(string $str) : string
deprecated |
Replaced by rcube_db::escape |
---|---|
see | \rcube_db::escape |
string
A string to escape
string
Escaped string for use in a query
quote_identifier(string $str) : string
string
Value to quote
string
Quoted string for use in query
array2list(array $arr, string $type = null) : string
array
Input array
string
Type of data (integer, bool, ident)
string
Comma-separated list of quoted values for use in query
fromunixtime(int $timestamp) : string
int
Unix timestamp
string
Date string in db-specific format
concat() : string
string
SQL statement to be used in query
encode(mixed $input, bool $serialized = false) : mixed
mixed
Data to fix
bool
Enable serialization
mixed
Properly UTF-8 encoded data
decode(mixed $input, bool $serialized = false) : mixed
mixed
Input data
bool
Enable serialization
mixed
Decoded data
table_name(string $table) : string
string
Table name
string
Translated table name
set_option(string $name, mixed $value)
string
Option name
mixed
Option value
set_table_dsn($table, $mode)
parse_dsn($dsn) : array
array
DSN parameters
DEBUG_LINE_LENGTH
db_provider :
db_dsnw :
db_dsnr :
db_connected :
db_mode :
db_table_dsn_map :
dbh :
dbhs :
table_connections :
db_error :
db_error_msg :
conn_failure :
db_index :
last_result :
tables :
variables :