Decodes encoded UTF-8 string/object/array (recursive)
mixed
decode
(mixed $input)
Encodes non-UTF-8 characters in string/array/object (recursive)
mixed
encode
(mixed $input)
-
mixed
$input: Data to fix
Factory, returns driver-specific instance of the class
rcube_db
factory
(
string $db_dsnw, [
string $db_dsnr =
''], [
bool $pconn =
false])
-
string
$db_dsnw: DSN for read/write operations
-
string
$db_dsnr: Optional DSN for read only operations
-
bool
$pconn: Enables persistent connections
MDB2 DSN string parser
array
parse_dsn
( $dsn, string $sequence)
-
string
$sequence: Secuence name
-
$dsn
Object constructor
rcube_db
__construct
(string $db_dsnw, [string $db_dsnr = ''], [bool $pconn = false])
-
string
$db_dsnw: DSN for read/write operations
-
string
$db_dsnr: Optional DSN for read only operations
-
bool
$pconn: Enables persistent connections
Get number of affected rows for the last query
int
affected_rows
([mixed $result = null])
-
mixed
$result: Optional query handle
Return list of elements for use with SQL's IN clause
string
array2list
(array $arr, [string $type = null])
-
array
$arr: Input array
-
string
$type: Type of data (integer, bool, ident)
Abstract SQL statement for value concatenation
string
concat
()
Redefined in descendants as:
Driver-specific configuration of database connection
void
conn_configure
(array $dsn, PDO $dbh)
-
array
$dsn: DSN for DB connections
-
PDO
$dbh: Connection handler
Redefined in descendants as:
Driver-specific preparation of database connection
void
conn_prepare
(array $dsn)
-
array
$dsn: DSN for DB connections
Redefined in descendants as:
Connect to appropriate database depending on the operation
void
db_connect
(string $mode)
-
string
$mode: Connection mode (r|w)
Writes debug information/query to 'sql' log file
void
debug
(string $query)
Connect to specific database
PDO
dsn_connect
(array $dsn)
-
array
$dsn: DSN for DB connections
Returns driver-specific connection options
array
dsn_options
(array $dsn)
-
array
$dsn: DSN parameters
Redefined in descendants as:
Returns PDO DSN string from DSN array
string
dsn_string
(array $dsn)
-
array
$dsn: DSN parameters
Redefined in descendants as:
Escapes a string so it can be safely used in a query
string
escape
(string $str)
-
string
$str: A string to escape
Escapes a string so it can be safely used in a query
string
escapeSimple
(string $str)
-
string
$str: A string to escape
Get an index array for one row If no query handle is specified, the last query will be taken as reference
mixed
fetch_array
([mixed $result = null])
-
mixed
$result: Optional query handle
Get an associative array for one row If no query handle is specified, the last query will be taken as reference
mixed
fetch_assoc
([mixed $result = null])
-
mixed
$result: Optional query handle
Return SQL statement to convert from a unix timestamp
string
fromunixtime
(int $timestamp)
-
int
$timestamp: Unix timestamp
Get database runtime variables
mixed
get_variable
(string $varname, [mixed $default = null])
-
string
$varname: Variable name
-
mixed
$default: Default value if variable is not set
Redefined in descendants as:
Return SQL statement for case insensitive LIKE
string
ilike
(string $column, string $value)
-
string
$column: Field name
-
string
$value: Search value
Redefined in descendants as:
Initialization of the object with driver specific code
void
init
()
Redefined in descendants as:
Get last inserted record ID
mixed
insert_id
([string $table = ''])
-
string
$table: Table name (to find the incremented sequence)
Redefined in descendants as:
Connection state checker
boolean
is_connected
()
Getter for error state
string
is_error
([mixed $result = null])
-
mixed
$result: Optional query result
Is database replication configured?
bool
is_replicated
()
Execute a SQL query with limits
PDOStatement|bool
limitquery
(string 0, int 1, int 2, mixed 3)
-
string
0: SQL query to execute
-
int
1: Offset for LIMIT statement
-
int
2: Number of rows for LIMIT statement
-
mixed
3: Values to be inserted in query
Returns list of columns in database table
array
list_cols
(string $table)
-
string
$table: Table name
Redefined in descendants as:
Returns list of tables in a database
array
list_tables
()
Redefined in descendants as:
Return SQL function for current time and date
string
now
()
Redefined in descendants as:
Get number of rows for a SQL query If no query handle is specified, the last query will be taken as reference
mixed
num_rows
([mixed $result = null])
-
mixed
$result: Optional query handle
Execute a SQL query
number
query
(string 0, mixed 1)
-
string
0: SQL query to execute
-
mixed
1: Values to be inserted in query
Formats input so it can be safely used in a query
string
quote
(mixed $input, [string $type = null])
-
mixed
$input: Value to quote
-
string
$type: Type of data (integer, bool, ident)
Quotes a string so it can be safely used as a table or column name
string
quoteIdentifier
(string $str)
-
string
$str: Value to quote
Quotes a string so it can be safely used as a table or column name
string
quote_identifier
(string $str)
-
string
$str: Value to quote
Driver-specific database character set setting
void
set_charset
(string $charset)
-
string
$charset: Character set name
Redefined in descendants as:
Activate/deactivate debug mode
void
set_debug
([boolean $dbg = true])
-
boolean
$dbg: True if SQL queries should be logged
Adds LIMIT,OFFSET clauses to the query
string
set_limit
(string $query, [int $limit = 0], [int $offset = 0])
-
string
$query: SQL query
-
int
$limit: Number of rows
-
int
$offset: Offset
Redefined in descendants as:
Return correct name for a specific database table
string
table_name
(string $table)
-
string
$table: Table name
Return SQL statement to convert a field value into a unix timestamp
This method is deprecated and should not be used anymore due to limitations of timestamp functions in Mysql (year 2038 problem)
string
unixtimestamp
(string $field)
-
string
$field: Field name
Redefined in descendants as:
Get col values for a result row
mixed
_fetch_row
(mixed $result, int $mode)
-
mixed
$result: Optional query handle
-
int
$mode: Fetch mode identifier
Execute a SQL query with limits
PDOStatement|bool
_query
(string $query, int $offset, int $numrows, array $params)
-
string
$query: SQL query to execute
-
int
$offset: Offset for LIMIT statement
-
int
$numrows: Number of rows for LIMIT statement
-
array
$params: Values to be inserted in query