ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Public Member Functions | |
__construct () | |
Constructor. More... | |
MDB2_Driver_Common () | |
PHP 4 Constructor. More... | |
__destruct () | |
Destructor. More... | |
free () | |
Free the internal references so that the instance can be destroyed. More... | |
__toString () | |
String conversation. More... | |
errorInfo ($error=null) | |
This method is used to collect information about an error. More... | |
& | raiseError ($code=null, $mode=null, $options=null, $userinfo=null, $method=null) |
This method is used to communicate an error and invoke error callbacks etc. More... | |
resetWarnings () | |
reset the warning array More... | |
getWarnings () | |
Get all warnings in reverse order. More... | |
setFetchMode ($fetchmode, $object_class='stdClass') | |
Sets which fetch mode should be used by default on queries on this connection. More... | |
setOption ($option, $value) | |
set the option for the db class More... | |
getOption ($option) | |
Returns the value of an option. More... | |
debug ($message, $scope='', $context=array()) | |
set a debug message More... | |
getDebugOutput () | |
output debug info More... | |
escape ($text, $escape_wildcards=false) | |
Quotes a string so it can be safely used in a query. More... | |
escapePattern ($text) | |
Quotes pattern (% and _) characters in a string) More... | |
quoteIdentifier ($str, $check_option=false) | |
Quote a string so it can be safely used as a table or column name. More... | |
getAsKeyword () | |
Gets the string to alias column. More... | |
getConnection () | |
Returns a native connection. More... | |
_fixResultArrayValues (&$row, $mode) | |
Do all necessary conversions on result arrays to fix DBMS quirks. More... | |
& | loadModule ($module, $property=null, $phptype_specific=null) |
loads a module More... | |
__call ($method, $params) | |
Calls a module method using the __call magic method. More... | |
beginTransaction ($savepoint=null) | |
Start a transaction or set a savepoint. More... | |
commit ($savepoint=null) | |
Commit the database changes done during a transaction that is in progress or release a savepoint. More... | |
rollback ($savepoint=null) | |
Cancel any database changes done during a transaction or since a specific savepoint that is in progress. More... | |
inTransaction ($ignore_nested=false) | |
If a transaction is currently open. More... | |
setTransactionIsolation ($isolation, $options=array()) | |
Set the transacton isolation level. More... | |
beginNestedTransaction () | |
Start a nested transaction. More... | |
completeNestedTransaction ($force_rollback=false) | |
Finish a nested transaction by rolling back if an error occured or committing otherwise. More... | |
failNestedTransaction ($error=null, $immediately=false) | |
Force setting nested transaction to failed. More... | |
getNestedTransactionError () | |
The first error that occured since the transaction start. More... | |
connect () | |
Connect to the database. More... | |
setCharset ($charset, $connection=null) | |
Set the charset on the current connection. More... | |
disconnect ($force=true) | |
Log out and disconnect from the database. More... | |
setDatabase ($name) | |
Select a different database. More... | |
getDatabase () | |
Get the current database. More... | |
setDSN ($dsn) | |
set the DSN More... | |
getDSN ($type='string', $hidepw=false) | |
return the DSN as a string More... | |
& | standaloneQuery ($query, $types=null, $is_manip=false) |
execute a query as database administrator More... | |
_modifyQuery ($query, $is_manip, $limit, $offset) | |
Changes a query string for various DBMS specific reasons. More... | |
& | _doQuery ($query, $is_manip=false, $connection=null, $database_name=null) |
Execute a query. More... | |
_affectedRows ($connection, $result=null) | |
Returns the number of rows affected. More... | |
& | exec ($query) |
Execute a manipulation query to the database and return the number of affected rows. More... | |
& | query ($query, $types=null, $result_class=true, $result_wrap_class=false) |
Send a query to the database and return any results. More... | |
& | _wrapResult ($result, $types=array(), $result_class=true, $result_wrap_class=false, $limit=null, $offset=null) |
wrap a result set into the correct class More... | |
getServerVersion ($native=false) | |
return version information about the server More... | |
setLimit ($limit, $offset=null) | |
set the range of the next query More... | |
subSelect ($query, $type=false) | |
simple subselect emulation: leaves the query untouched for all RDBMS that support subselects More... | |
replace ($table, $fields) | |
Execute a SQL REPLACE query. More... | |
& | prepare ($query, $types=null, $result_types=null, $lobs=array()) |
Prepares a query for multiple execution with execute(). More... | |
_skipDelimitedStrings ($query, $position, $p_position) | |
Utility method, used by prepare() to avoid replacing placeholders within delimited strings. More... | |
quote ($value, $type=null, $quote=true, $escape_wildcards=false) | |
Convert a text value into a DBMS specific format that is suitable to compose query statements. More... | |
getDeclaration ($type, $name, $field) | |
Obtain DBMS specific SQL code portion needed to declare of the given type. More... | |
compareDefinition ($current, $previous) | |
Obtain an array of changes that may need to applied. More... | |
supports ($feature) | |
Tell whether a DB implementation or its backend extension supports a given feature. More... | |
getSequenceName ($sqn) | |
adds sequence name formatting to a sequence name More... | |
getIndexName ($idx) | |
adds index name formatting to a index name More... | |
nextID ($seq_name, $ondemand=true) | |
Returns the next free id of a sequence. More... | |
lastInsertID ($table=null, $field=null) | |
Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table. More... | |
currID ($seq_name) | |
Returns the current id of a sequence. More... | |
queryOne ($query, $type=null, $colnum=0) | |
Execute the specified query, fetch the value from the first column of the first row of the result set and then frees the result set. More... | |
queryRow ($query, $types=null, $fetchmode=MDB2_FETCHMODE_DEFAULT) | |
Execute the specified query, fetch the values from the first row of the result set into an array and then frees the result set. More... | |
queryCol ($query, $type=null, $colnum=0) | |
Execute the specified query, fetch the value from the first column of each row of the result set into an array and then frees the result set. More... | |
queryAll ($query, $types=null, $fetchmode=MDB2_FETCHMODE_DEFAULT, $rekey=false, $force_array=false, $group=false) | |
Execute the specified query, fetch all the rows of the result set into a two dimensional array and then frees the result set. More... | |
Public Member Functions inherited from PEAR | |
__construct ($error_class=null) | |
Constructor. More... | |
_PEAR () | |
Destructor (the emulated type of...). More... | |
registerShutdownFunc ($func, $args=array()) | |
Use this function to register a shutdown method for static classes. More... | |
isError ($data, $code=null) | |
Tell whether a value is a PEAR error. More... | |
expectError ($code=' *') | |
This method is used to tell which errors you expect to get. More... | |
popExpect () | |
This method pops one element off the expected error codes stack. More... | |
_checkDelExpect ($error_code) | |
This method checks unsets an error code if available. More... | |
delExpect ($error_code) | |
This method deletes all occurences of the specified element from the expected error codes stack. More... | |
& | raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false) |
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More... | |
& | throwError ($message=null, $code=null, $userinfo=null) |
Simpler form of raiseError with fewer options. More... | |
staticPushErrorHandling ($mode, $options=null) | |
staticPopErrorHandling () | |
pushErrorHandling ($mode, $options=null) | |
Push a new error handler on top of the error handler options stack. More... | |
popErrorHandling () | |
Pop the last error handler used. More... | |
loadExtension ($ext) | |
OS independant PHP extension load. More... | |
Data Fields | |
$db_index = 0 | |
$dsn = array() | |
$connected_dsn = array() | |
$connection = 0 | |
$opened_persistent | |
$database_name = '' | |
$connected_database_name = '' | |
$connected_server_info = '' | |
$supported | |
$options | |
$string_quoting = array('start' => "'", 'end' => "'", 'escape' => false, 'escape_pattern' => false) | |
$identifier_quoting = array('start' => '"', 'end' => '"', 'escape' => '"') | |
$sql_comments | |
$wildcards = array('%', '_') | |
$as_keyword = ' AS ' | |
$warnings = array() | |
$debug_output = '' | |
$in_transaction = false | |
$nested_transaction_counter = null | |
$has_transaction_error = false | |
$offset = 0 | |
$limit = 0 | |
$phptype | |
$dbsyntax | |
$last_query | |
$fetchmode = MDB2_FETCHMODE_ORDERED | |
$modules = array() | |
$destructor_registered = true | |
Data Fields inherited from PEAR | |
$_debug = false | |
$_default_error_mode = null | |
$_default_error_options = null | |
$_default_error_handler = '' | |
$_error_class = 'PEAR_Error' | |
$_expected_errors = array() | |
Additional Inherited Members | |
Static Public Member Functions inherited from PEAR | |
static & | getStaticProperty ($class, $var) |
If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More... | |
static | setErrorHandling ($mode=null, $options=null) |
Sets how errors generated by this object should be handled. More... | |
MDB2_Driver_Common::__construct | ( | ) |
Constructor.
Definition at line 1301 of file MDB2.php.
References $GLOBALS.
MDB2_Driver_Common::__destruct | ( | ) |
Destructor.
Definition at line 1327 of file MDB2.php.
MDB2_Driver_Common::__call | ( | $method, | |
$params | |||
) |
Calls a module method using the __call magic method.
string | Method name. |
array | Arguments. |
Definition at line 1914 of file MDB2.php.
References $params, $result, array, and PEAR\isError().
MDB2_Driver_Common::__toString | ( | ) |
MDB2_Driver_Common::_affectedRows | ( | $connection, | |
$result = null |
|||
) |
Returns the number of rows affected.
resource | result handle |
resource | connection handle |
private
Definition at line 2452 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
& MDB2_Driver_Common::_doQuery | ( | $query, | |
$is_manip = false , |
|||
$connection = null , |
|||
$database_name = null |
|||
) |
Execute a query.
string | query |
bool | if the query is a manipulation query |
resource | connection handle |
string | database name |
protected
Definition at line 2424 of file MDB2.php.
References $query, $result, array, PEAR\isError(), MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::_fixResultArrayValues | ( | & | $row, |
$mode | |||
) |
Do all necessary conversions on result arrays to fix DBMS quirks.
array | the array to be fixed (passed by reference) |
array | bit-wise addition of the required portability modes |
protected
Definition at line 1760 of file MDB2.php.
References $row, array, MDB2_PORTABILITY_EMPTY_TO_NULL, MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES, and MDB2_PORTABILITY_RTRIM.
MDB2_Driver_Common::_modifyQuery | ( | $query, | |
$is_manip, | |||
$limit, | |||
$offset | |||
) |
MDB2_Driver_Common::_skipDelimitedStrings | ( | $query, | |
$position, | |||
$p_position | |||
) |
Utility method, used by prepare() to avoid replacing placeholders within delimited strings.
Check if the placeholder is contained within a delimited string. If so, skip it and advance the position, otherwise return the current position, which is valid
string | $query | |
integer | $position | current string cursor position |
integer | $p_position | placeholder position |
protected
Definition at line 2968 of file MDB2.php.
References $ignore, $query, MDB2_ERROR_SYNTAX, and MDB2\raiseError().
Referenced by MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), and MDB2_Driver_mysqli\prepare().
& MDB2_Driver_Common::_wrapResult | ( | $result, | |
$types = array() , |
|||
$result_class = true , |
|||
$result_wrap_class = false , |
|||
$limit = null , |
|||
$offset = null |
|||
) |
wrap a result set into the correct class
resource | result handle |
mixed | array that contains the types of the columns in the result set |
mixed | string which specifies which result class to use |
mixed | string which specifies which class to wrap results in |
string | number of rows to select |
string | first row to select |
protected
Definition at line 2546 of file MDB2.php.
References $result, array, MDB2\classExists(), PEAR\isError(), MDB2\isResultCommon(), MDB2_ERROR_NOT_FOUND, and MDB2\raiseError().
Referenced by MDB2_Driver_oci8\standaloneQuery(), and MDB2_Driver_pgsql\standaloneQuery().
MDB2_Driver_Common::beginNestedTransaction | ( | ) |
Start a nested transaction.
EXPERIMENTAL
WARNING: this function is experimental and may change signature at any time until labelled as non-experimental
public
Definition at line 2068 of file MDB2.php.
References $result, and MDB2_OK.
MDB2_Driver_Common::beginTransaction | ( | $savepoint = null | ) |
Start a transaction or set a savepoint.
string | name of a savepoint to set |
public
Definition at line 1955 of file MDB2.php.
References array, MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::commit | ( | $savepoint = null | ) |
Commit the database changes done during a transaction that is in progress or release a savepoint.
This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after committing the pending changes.
string | name of a savepoint to release |
public
Definition at line 1976 of file MDB2.php.
References array, MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::compareDefinition | ( | $current, | |
$previous | |||
) |
Obtain an array of changes that may need to applied.
array | new definition |
array | old definition |
public
Definition at line 3062 of file MDB2.php.
References $result, and PEAR\isError().
MDB2_Driver_Common::completeNestedTransaction | ( | $force_rollback = false | ) |
Finish a nested transaction by rolling back if an error occured or committing otherwise.
EXPERIMENTAL
WARNING: this function is experimental and may change signature at any time until labelled as non-experimental
bool | if the transaction should be rolled back regardless even if no error was set within the nested transaction |
public
Definition at line 2104 of file MDB2.php.
References $result, PEAR\isError(), and MDB2_OK.
MDB2_Driver_Common::connect | ( | ) |
Connect to the database.
Definition at line 2204 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::currID | ( | $seq_name | ) |
Returns the current id of a sequence.
string | name of the sequence |
public
Definition at line 3182 of file MDB2.php.
MDB2_Driver_Common::debug | ( | $message, | |
$scope = '' , |
|||
$context = array() |
|||
) |
set a debug message
string | message that should be appended to the debug variable |
string | usually the method name that triggered the debug call: for example 'query', 'prepare', 'execute', 'parameters', 'beginTransaction', 'commit', 'rollback' |
array | contains context information about the debug() call common keys are: is_manip, time, result etc. |
public
Definition at line 1587 of file MDB2.php.
References array.
Referenced by MDB2_Driver_mysql\_doQuery(), MDB2_Driver_mysqli\_doQuery(), MDB2_Driver_pgsql\_doQuery(), MDB2_Driver_oci8\_doQuery(), MDB2_Driver_oci8\beginTransaction(), MDB2_Driver_mysql\beginTransaction(), MDB2_Driver_mysqli\beginTransaction(), MDB2_Driver_pgsql\beginTransaction(), MDB2_Driver_oci8\commit(), MDB2_Driver_mysqli\commit(), MDB2_Driver_mysql\commit(), MDB2_Driver_pgsql\commit(), MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), MDB2_Driver_mysqli\prepare(), MDB2_Driver_oci8\rollback(), MDB2_Driver_pgsql\rollback(), MDB2_Driver_mysqli\rollback(), MDB2_Driver_mysql\rollback(), MDB2_Driver_oci8\setTransactionIsolation(), MDB2_Driver_pgsql\setTransactionIsolation(), MDB2_Driver_mysqli\setTransactionIsolation(), and MDB2_Driver_mysql\setTransactionIsolation().
MDB2_Driver_Common::disconnect | ( | $force = true | ) |
Log out and disconnect from the database.
bool | if the disconnect should be forced even if the connection is opened persistently |
public
Definition at line 2241 of file MDB2.php.
References array, and MDB2_OK.
MDB2_Driver_Common::errorInfo | ( | $error = null | ) |
MDB2_Driver_Common::escape | ( | $text, | |
$escape_wildcards = false |
|||
) |
Quotes a string so it can be safely used in a query.
It will quote the text so it can safely be used within a query.
string | the input string to quote |
bool | escape wildcards |
public
Definition at line 1630 of file MDB2.php.
References $text.
MDB2_Driver_Common::escapePattern | ( | $text | ) |
Quotes pattern (% and _) characters in a string)
EXPERIMENTAL
WARNING: this function is experimental and may change signature at any time until labelled as non-experimental
string | the input string to quote |
public
Definition at line 1657 of file MDB2.php.
References $text.
Referenced by MDB2_Driver_mysql\escape(), MDB2_Driver_mysqli\escape(), and MDB2_Driver_pgsql\escape().
& MDB2_Driver_Common::exec | ( | $query | ) |
Execute a manipulation query to the database and return the number of affected rows.
string | the SQL query |
public
Definition at line 2470 of file MDB2.php.
References $query, $result, and PEAR\isError().
MDB2_Driver_Common::failNestedTransaction | ( | $error = null , |
|
$immediately = false |
|||
) |
Force setting nested transaction to failed.
EXPERIMENTAL
WARNING: this function is experimental and may change signature at any time until labelled as non-experimental
mixed | value to return in getNestededTransactionError() |
bool | if the transaction should be rolled back immediately |
public
Definition at line 2161 of file MDB2.php.
References $error, and MDB2_OK.
MDB2_Driver_Common::free | ( | ) |
Free the internal references so that the instance can be destroyed.
public
Definition at line 1342 of file MDB2.php.
References $GLOBALS, and MDB2_OK.
MDB2_Driver_Common::getAsKeyword | ( | ) |
MDB2_Driver_Common::getConnection | ( | ) |
Returns a native connection.
public
Definition at line 1738 of file MDB2.php.
References $result, MDB2\connect(), and PEAR\isError().
Referenced by MDB2_Driver_mysql\_affectedRows(), MDB2_Driver_mysqli\_affectedRows(), MDB2_Driver_pgsql\_affectedRows(), MDB2_Driver_oci8\_affectedRows(), MDB2_Driver_mysql\_doQuery(), MDB2_Driver_mysqli\_doQuery(), MDB2_Driver_pgsql\_doQuery(), MDB2_Driver_oci8\_doQuery(), MDB2_Driver_oci8\commit(), MDB2_Driver_mysql\escape(), MDB2_Driver_mysqli\escape(), MDB2_Driver_pgsql\escape(), MDB2_Driver_mysql\getServerVersion(), MDB2_Driver_oci8\getServerVersion(), MDB2_Driver_mysqli\getServerVersion(), MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), MDB2_Driver_mysqli\prepare(), MDB2_Driver_mysql\replace(), MDB2_Driver_mysqli\replace(), MDB2_Driver_oci8\rollback(), MDB2_Driver_pgsql\setCharset(), MDB2_Driver_mysql\setCharset(), and MDB2_Driver_mysqli\setCharset().
MDB2_Driver_Common::getDatabase | ( | ) |
MDB2_Driver_Common::getDebugOutput | ( | ) |
MDB2_Driver_Common::getDeclaration | ( | $type, | |
$name, | |||
$field | |||
) |
Obtain DBMS specific SQL code portion needed to declare of the given type.
string | type to which the value should be converted to |
string | name the field to be declared. |
string | definition of the field |
public
Definition at line 3040 of file MDB2.php.
References $result, and PEAR\isError().
MDB2_Driver_Common::getDSN | ( | $type = 'string' , |
|
$hidepw = false |
|||
) |
return the DSN as a string
string | format to return ("array", "string") |
string | string to hide the password with |
public
Definition at line 2325 of file MDB2.php.
References $GLOBALS.
MDB2_Driver_Common::getIndexName | ( | $idx | ) |
MDB2_Driver_Common::getNestedTransactionError | ( | ) |
The first error that occured since the transaction start.
EXPERIMENTAL
WARNING: this function is experimental and may change signature at any time until labelled as non-experimental
public
Definition at line 2191 of file MDB2.php.
MDB2_Driver_Common::getOption | ( | $option | ) |
Returns the value of an option.
string | option name |
public
Definition at line 1561 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
Referenced by MDB2_Driver_oci8\_doQuery().
MDB2_Driver_Common::getSequenceName | ( | $sqn | ) |
adds sequence name formatting to a sequence name
string | name of the sequence |
public
Definition at line 3107 of file MDB2.php.
Referenced by MDB2_Driver_oci8\currId(), MDB2_Driver_mysql\currID(), MDB2_Driver_mysqli\currID(), MDB2_Driver_oci8\lastInsertID(), MDB2_Driver_oci8\nextID(), MDB2_Driver_mysql\nextID(), and MDB2_Driver_mysqli\nextID().
MDB2_Driver_Common::getServerVersion | ( | $native = false | ) |
return version information about the server
bool | determines if the raw version string should be returned |
public
Definition at line 2617 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::getWarnings | ( | ) |
Get all warnings in reverse order.
This means that the last warning is the first element in the array
public
MDB2_Driver_Common::inTransaction | ( | $ignore_nested = false | ) |
If a transaction is currently open.
bool | if the nested transaction count should be ignored |
public
Definition at line 2018 of file MDB2.php.
MDB2_Driver_Common::lastInsertID | ( | $table = null , |
|
$field = null |
|||
) |
Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table.
(empty($field) ? '' : '_'.$field)
string | name of the table into which a new row was inserted |
string | name of the field into which a new row was inserted |
public
Definition at line 3164 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
& MDB2_Driver_Common::loadModule | ( | $module, | |
$property = null , |
|||
$phptype_specific = null |
|||
) |
loads a module
string | name of the module that should be loaded (only used for error messages) |
string | name of the property into which the class will be loaded |
bool | if the class to load for the module is specific to the phptype |
public
Definition at line 1845 of file MDB2.php.
References $version, array, MDB2\classExists(), MDB2\fileExists(), PEAR\isError(), MDB2\loadClass(), MDB2_ERROR_LOADMODULE, and MDB2\raiseError().
Referenced by MDB2_Driver_oci8\nextID(), MDB2_Driver_pgsql\nextID(), MDB2_Driver_mysql\nextID(), MDB2_Driver_mysqli\nextID(), and MDB2_Driver_pgsql\prepare().
MDB2_Driver_Common::MDB2_Driver_Common | ( | ) |
MDB2_Driver_Common::nextID | ( | $seq_name, | |
$ondemand = true |
|||
) |
Returns the next free id of a sequence.
string | name of the sequence |
bool | when true missing sequences are automatic created |
public
Definition at line 3144 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
& MDB2_Driver_Common::prepare | ( | $query, | |
$types = null , |
|||
$result_types = null , |
|||
$lobs = array() |
|||
) |
Prepares a query for multiple execution with execute().
With some database backends, this is emulated. prepare() requires a generic query as string like 'INSERT INTO numbers VALUES(?,?)' or 'INSERT INTO numbers VALUES(:foo,:bar)'. The ? and :[a-zA-Z] and are placeholders which can be set using bindParam() and the query can be send off using the execute() method.
string | the query to prepare |
mixed | array that contains the types of the placeholders |
mixed | array that contains the types of the columns in the result set or MDB2_PREPARE_RESULT, if set to MDB2_PREPARE_MANIP the query is handled as a manipulation query |
mixed | key (field) value (parameter) pair for all lob placeholders |
public
Definition at line 2860 of file MDB2.php.
References $query, $result, array, PEAR\isError(), MDB2_ERROR_SYNTAX, MDB2_PREPARE_MANIP, and MDB2\raiseError().
& MDB2_Driver_Common::query | ( | $query, | |
$types = null , |
|||
$result_class = true , |
|||
$result_wrap_class = false |
|||
) |
Send a query to the database and return any results.
string | the SQL query |
mixed | array that contains the types of the columns in the result set |
mixed | string which specifies which result class to use |
mixed | string which specifies which class to wrap results in |
public
Definition at line 2507 of file MDB2.php.
References $query, $result, and PEAR\isError().
Referenced by MDB2_Statement_pgsql\_execute(), MDB2_Statement_oci8\_execute(), MDB2_Statement_mysql\_execute(), and MDB2_Statement_mysqli\_execute().
MDB2_Driver_Common::queryAll | ( | $query, | |
$types = null , |
|||
$fetchmode = MDB2_FETCHMODE_DEFAULT , |
|||
$rekey = false , |
|||
$force_array = false , |
|||
$group = false |
|||
) |
Execute the specified query, fetch all the rows of the result set into a two dimensional array and then frees the result set.
string | the SELECT query statement to be executed. |
array | optional array argument that specifies a list of expected datatypes of the result set columns, so that the eventual conversions may be performed. The default list of datatypes is empty, meaning that no conversion is performed. |
int | how the array data should be indexed |
bool | if set to true, the $all will have the first column as its first dimension |
bool | used only when the query returns exactly two columns. If true, the values of the returned array will be one-element arrays instead of scalars. |
bool | if true, the values of the returned array is wrapped in another array. If the same key value (in the first column) repeats itself, the values will be appended to this array instead of overwriting the existing values. |
public
Definition at line 3308 of file MDB2.php.
References $query, $result, and MDB2\isResultCommon().
MDB2_Driver_Common::queryCol | ( | $query, | |
$type = null , |
|||
$colnum = 0 |
|||
) |
Execute the specified query, fetch the value from the first column of each row of the result set into an array and then frees the result set.
string | the SELECT query statement to be executed. |
string | optional argument that specifies the expected datatype of the result set field, so that an eventual conversion may be performed. The default datatype is text, meaning that no conversion is performed |
int | the row number to fetch |
public
Definition at line 3269 of file MDB2.php.
References $query, $result, and MDB2\isResultCommon().
MDB2_Driver_Common::queryOne | ( | $query, | |
$type = null , |
|||
$colnum = 0 |
|||
) |
Execute the specified query, fetch the value from the first column of the first row of the result set and then frees the result set.
string | the SELECT query statement to be executed. |
string | optional argument that specifies the expected datatype of the result set field, so that an eventual conversion may be performed. The default datatype is text, meaning that no conversion is performed |
int | the column number to fetch |
public
Definition at line 3208 of file MDB2.php.
References $query, $result, and MDB2\isResultCommon().
Referenced by MDB2_Driver_oci8\currId(), MDB2_Driver_pgsql\currID(), MDB2_Driver_mysql\currID(), MDB2_Driver_mysqli\currID(), MDB2_Driver_pgsql\getSequenceName(), MDB2_Driver_pgsql\getServerVersion(), MDB2_Driver_oci8\lastInsertID(), MDB2_Driver_pgsql\lastInsertID(), MDB2_Driver_mysql\lastInsertID(), MDB2_Driver_mysqli\lastInsertID(), MDB2_Driver_oci8\nextID(), and MDB2_Driver_pgsql\nextID().
MDB2_Driver_Common::queryRow | ( | $query, | |
$types = null , |
|||
$fetchmode = MDB2_FETCHMODE_DEFAULT |
|||
) |
Execute the specified query, fetch the values from the first row of the result set into an array and then frees the result set.
string | the SELECT query statement to be executed. |
array | optional array argument that specifies a list of expected datatypes of the result set columns, so that the eventual conversions may be performed. The default list of datatypes is empty, meaning that no conversion is performed. |
int | how the array data should be indexed |
public
Definition at line 3239 of file MDB2.php.
References $query, $result, $row, and MDB2\isResultCommon().
MDB2_Driver_Common::quote | ( | $value, | |
$type = null , |
|||
$quote = true , |
|||
$escape_wildcards = false |
|||
) |
Convert a text value into a DBMS specific format that is suitable to compose query statements.
string | text string value that is intended to be converted. |
string | type to which the value should be converted to |
bool | quote |
bool | escape wildcards |
public
Definition at line 3014 of file MDB2.php.
References $result, and PEAR\isError().
Referenced by MDB2_Driver_pgsql\getSequenceName(), MDB2_Driver_oci8\prepare(), MDB2_Driver_mysql\replace(), and MDB2_Driver_mysqli\replace().
MDB2_Driver_Common::quoteIdentifier | ( | $str, | |
$check_option = false |
|||
) |
Quote a string so it can be safely used as a table or column name.
Delimiting style depends on which database driver is being used.
NOTE: just because you CAN use delimited identifiers doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve.
Portability is broken by using the following characters inside delimited identifiers:
`
) – due to MySQL"
) – due to Oracle[
or ]
) – due to AccessDelimited identifiers are known to generally work correctly under the following drivers:
InterBase doesn't seem to be able to use delimited identifiers via PHP 4. They work fine under PHP 5.
string | identifier name to be quoted |
bool | check the 'quote_identifier' option |
public
Definition at line 1705 of file MDB2.php.
Referenced by MDB2_Driver_pgsql\currID(), MDB2_Driver_mysql\currID(), MDB2_Driver_mysqli\currID(), MDB2_Driver_oci8\lastInsertID(), MDB2_Driver_oci8\nextID(), MDB2_Driver_pgsql\nextID(), MDB2_Driver_mysql\nextID(), and MDB2_Driver_mysqli\nextID().
& MDB2_Driver_Common::raiseError | ( | $code = null , |
|
$mode = null , |
|||
$options = null , |
|||
$userinfo = null , |
|||
$method = null |
|||
) |
This method is used to communicate an error and invoke error callbacks etc.
Basically a wrapper for PEAR::raiseError without the message string.
mixed | integer error code, or a PEAR error object (all other parameters are ignored if this parameter is an object |
int | error mode, see PEAR_Error docs |
mixed | If error mode is PEAR_ERROR_TRIGGER, this is the error level (E_USER_NOTICE etc). If error mode is PEAR_ERROR_CALLBACK, this is the callback function, either as a function name, or as an array of an object and method name. For other error modes this parameter is ignored. |
string | Extra debug information. Defaults to the last query and native error code. |
string | name of the method that triggered the error |
public
Definition at line 1412 of file MDB2.php.
References $code, PEAR\isError(), MDB2_ERROR_NOT_FOUND, PEAR_ERROR_RETURN, and PEAR\raiseError().
Referenced by MDB2_Driver_oci8\_doConnect(), MDB2_Driver_pgsql\_doConnect(), MDB2_Driver_mysql\_doQuery(), MDB2_Driver_mysqli\_doQuery(), MDB2_Driver_pgsql\_doQuery(), MDB2_Driver_oci8\_doQuery(), MDB2_Driver_oci8\beginTransaction(), MDB2_Driver_mysql\beginTransaction(), MDB2_Driver_mysqli\beginTransaction(), MDB2_Driver_pgsql\beginTransaction(), MDB2_Driver_oci8\commit(), MDB2_Driver_mysqli\commit(), MDB2_Driver_mysql\commit(), MDB2_Driver_pgsql\commit(), MDB2_Driver_mysqli\connect(), MDB2_Driver_mysql\connect(), MDB2_Driver_pgsql\connect(), MDB2_Driver_mysql\getServerVersion(), MDB2_Driver_oci8\getServerVersion(), MDB2_Driver_mysqli\getServerVersion(), MDB2_Driver_pgsql\nextID(), MDB2_Driver_mysql\nextID(), MDB2_Driver_mysqli\nextID(), MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), MDB2_Driver_mysqli\prepare(), MDB2_Driver_mysql\replace(), MDB2_Driver_mysqli\replace(), MDB2_Driver_oci8\rollback(), MDB2_Driver_pgsql\rollback(), MDB2_Driver_mysqli\rollback(), MDB2_Driver_mysql\rollback(), MDB2_Driver_pgsql\setCharset(), MDB2_Driver_oci8\setTransactionIsolation(), MDB2_Driver_pgsql\setTransactionIsolation(), MDB2_Driver_mysqli\setTransactionIsolation(), MDB2_Driver_mysql\setTransactionIsolation(), and MDB2_Driver_pgsql\standaloneQuery().
MDB2_Driver_Common::replace | ( | $table, | |
$fields | |||
) |
Execute a SQL REPLACE query.
A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.
The REPLACE type of query does not make part of the SQL standards. Since practically only MySQL and SQLite implement it natively, this type of query isemulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.
string | name of the table on which the REPLACE query will be executed. |
array | associative array that describes the fields and the values that will be inserted or updated in the specified table. The indexes of the array are the names of all the fields of the table. The values of the array are also associative arrays that describe the values and other properties of the table fields. |
Here follows a list of field properties that need to be specified:
value Value to be assigned to the specified field. This value may be of specified in database independent type format as this function can perform the necessary datatype conversions.
Default: this property is required unless the Null property is set to 1.
type Name of the type of the field. Currently, all types MDB2 are supported except for clob and blob.
Default: no type conversion
null bool property that indicates that the value for this field should be set to null.
The default value for fields missing in INSERT queries may be specified the definition of a table. Often, the default value is already null, but since the REPLACE may be emulated using an UPDATE query, make sure that all fields of the table are listed in this function argument array.
Default: 0
key bool property that indicates that this field should be handled as a primary key or at least as part of the compound unique index of the table that will determine the row that will updated if it exists or inserted a new row otherwise.
This function will fail if no key field is specified or if the value of a key field is set to null because fields that are part of unique index they may not be null.
Default: 0
public
Definition at line 2765 of file MDB2.php.
References $insert, $query, $result, array, PEAR\isError(), MDB2_ERROR_CANNOT_REPLACE, MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::resetWarnings | ( | ) |
MDB2_Driver_Common::rollback | ( | $savepoint = null | ) |
Cancel any database changes done during a transaction or since a specific savepoint that is in progress.
This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after canceling the pending changes.
string | name of a savepoint to rollback to |
public
Definition at line 1997 of file MDB2.php.
References array, MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::setCharset | ( | $charset, | |
$connection = null |
|||
) |
Set the charset on the current connection.
string | charset |
resource | connection handle |
Definition at line 2221 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
Referenced by MDB2_Driver_oci8\_doConnect().
MDB2_Driver_Common::setDatabase | ( | $name | ) |
Select a different database.
string | name of the database that should be selected |
public
Definition at line 2265 of file MDB2.php.
MDB2_Driver_Common::setDSN | ( | $dsn | ) |
set the DSN
mixed | DSN string or array |
public
Definition at line 2300 of file MDB2.php.
References $GLOBALS, and MDB2\parseDSN().
MDB2_Driver_Common::setFetchMode | ( | $fetchmode, | |
$object_class = 'stdClass' |
|||
) |
Sets which fetch mode should be used by default on queries on this connection.
int | MDB2_FETCHMODE_ORDERED, MDB2_FETCHMODE_ASSOC or MDB2_FETCHMODE_OBJECT |
string | the class name of the object to be returned by the fetch methods when the MDB2_FETCHMODE_OBJECT mode is selected. If no class is specified by default a cast to object from the assoc array row will be done. There is also the possibility to use and extend the 'MDB2_row' class. |
public
Definition at line 1509 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, MDB2_FETCHMODE_ASSOC, MDB2_FETCHMODE_OBJECT, MDB2_FETCHMODE_ORDERED, MDB2_OK, and MDB2\raiseError().
MDB2_Driver_Common::setLimit | ( | $limit, | |
$offset = null |
|||
) |
set the range of the next query
string | number of rows to select |
string | first row to select |
public
Definition at line 2636 of file MDB2.php.
References MDB2_ERROR_SYNTAX, MDB2_ERROR_UNSUPPORTED, MDB2_OK, and MDB2\raiseError().
MDB2_Driver_Common::setOption | ( | $option, | |
$value | |||
) |
set the option for the db class
string | option name |
mixed | value for the option |
public
Definition at line 1539 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, MDB2_OK, and MDB2\raiseError().
MDB2_Driver_Common::setTransactionIsolation | ( | $isolation, | |
$options = array() |
|||
) |
Set the transacton isolation level.
string | standard isolation level READ UNCOMMITTED (allows dirty reads) READ COMMITTED (prevents dirty reads) REPEATABLE READ (prevents nonrepeatable reads) SERIALIZABLE (prevents phantom reads) |
array | some transaction options: 'wait' => 'WAIT' | 'NO WAIT' 'rw' => 'READ WRITE' | 'READ ONLY' |
public
Definition at line 2045 of file MDB2.php.
References array, MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
& MDB2_Driver_Common::standaloneQuery | ( | $query, | |
$types = null , |
|||
$is_manip = false |
|||
) |
execute a query as database administrator
string | the SQL query |
mixed | array that contains the types of the columns in the result set |
bool | if the query is a manipulation query |
public
Definition at line 2365 of file MDB2.php.
References $query, $result, and PEAR\isError().
MDB2_Driver_Common::subSelect | ( | $query, | |
$type = false |
|||
) |
simple subselect emulation: leaves the query untouched for all RDBMS that support subselects
string | the SQL query for the subselect that may only return a column |
string | determines type of the field |
public
Definition at line 2674 of file MDB2.php.
References $query, PEAR\isError(), MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
MDB2_Driver_Common::supports | ( | $feature | ) |
Tell whether a DB implementation or its backend extension supports a given feature.
string | name of the feature (see the MDB2 class doc) |
public
Definition at line 3086 of file MDB2.php.
References MDB2_ERROR_UNSUPPORTED, and MDB2\raiseError().
Referenced by MDB2_Driver_mysql\beginTransaction(), MDB2_Driver_mysqli\beginTransaction(), MDB2_Driver_mysqli\commit(), MDB2_Driver_mysql\commit(), MDB2_Driver_mysqli\rollback(), MDB2_Driver_mysql\rollback(), MDB2_Driver_mysqli\setTransactionIsolation(), and MDB2_Driver_mysql\setTransactionIsolation().
MDB2_Driver_Common::$connected_database_name = '' |
Definition at line 1045 of file MDB2.php.
Referenced by MDB2_Driver_oci8\disconnect(), MDB2_Driver_pgsql\disconnect(), MDB2_Driver_mysql\disconnect(), and MDB2_Driver_mysqli\disconnect().
MDB2_Driver_Common::$connected_dsn = array() |
Definition at line 1017 of file MDB2.php.
Referenced by MDB2_Driver_oci8\disconnect(), MDB2_Driver_pgsql\disconnect(), MDB2_Driver_mysql\disconnect(), and MDB2_Driver_mysqli\disconnect().
MDB2_Driver_Common::$connected_server_info = '' |
Definition at line 1052 of file MDB2.php.
Referenced by MDB2_Driver_mysql\getServerVersion(), MDB2_Driver_oci8\getServerVersion(), MDB2_Driver_mysqli\getServerVersion(), and MDB2_Driver_pgsql\getServerVersion().
MDB2_Driver_Common::$connection = 0 |
Definition at line 1024 of file MDB2.php.
Referenced by MDB2_Driver_mysql\_affectedRows(), MDB2_Driver_mysqli\_affectedRows(), MDB2_Driver_pgsql\_affectedRows(), MDB2_Driver_oci8\_affectedRows(), MDB2_Driver_oci8\_doConnect(), MDB2_Driver_pgsql\_doConnect(), MDB2_Driver_mysql\_doQuery(), MDB2_Driver_mysqli\_doQuery(), MDB2_Driver_pgsql\_doQuery(), MDB2_Driver_oci8\_doQuery(), MDB2_Statement_pgsql\_execute(), MDB2_Statement_oci8\_execute(), MDB2_Statement_mysql\_execute(), MDB2_Statement_mysqli\_execute(), MDB2_Driver_oci8\commit(), MDB2_Driver_mysqli\connect(), MDB2_Driver_mysql\connect(), MDB2_Driver_oci8\connect(), MDB2_Driver_pgsql\connect(), MDB2_Driver_mysql\escape(), MDB2_Driver_mysqli\escape(), MDB2_Driver_pgsql\escape(), MDB2_Statement_pgsql\free(), MDB2_Statement_mysql\free(), MDB2_Statement_mysqli\free(), MDB2_Driver_mysql\getServerVersion(), MDB2_Driver_oci8\getServerVersion(), MDB2_Driver_mysqli\getServerVersion(), MDB2_Result_pgsql\nextResult(), MDB2_Result_mysqli\nextResult(), MDB2_BufferedResult_mysqli\nextResult(), MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), MDB2_Driver_mysqli\prepare(), MDB2_Driver_mysql\replace(), MDB2_Driver_mysqli\replace(), MDB2_Driver_oci8\rollback(), MDB2_Driver_pgsql\setCharset(), MDB2_Driver_mysql\setCharset(), MDB2_Driver_mysqli\setCharset(), MDB2_Driver_oci8\standaloneExec(), MDB2_Driver_oci8\standaloneQuery(), and MDB2_Driver_pgsql\standaloneQuery().
MDB2_Driver_Common::$database_name = '' |
Definition at line 1038 of file MDB2.php.
Referenced by MDB2_Driver_oci8\_doConnect(), MDB2_Driver_pgsql\_doConnect(), MDB2_Driver_mysql\_doQuery(), MDB2_Driver_mysqli\_doQuery(), MDB2_Driver_mysqli\connect(), MDB2_Driver_mysql\connect(), MDB2_Driver_oci8\connect(), MDB2_Driver_pgsql\connect(), MDB2_Driver_oci8\disconnect(), MDB2_Driver_pgsql\disconnect(), MDB2_Driver_mysql\disconnect(), and MDB2_Driver_mysqli\disconnect().
MDB2_Driver_Common::$dsn = array() |
Definition at line 1010 of file MDB2.php.
Referenced by MDB2_Driver_mysqli\connect(), MDB2_Driver_mysql\connect(), MDB2_Driver_oci8\connect(), MDB2_Driver_pgsql\connect(), MDB2_Driver_oci8\disconnect(), MDB2_Driver_pgsql\disconnect(), MDB2_Driver_mysql\disconnect(), and MDB2_Driver_mysqli\disconnect().
MDB2_Driver_Common::$fetchmode = MDB2_FETCHMODE_ORDERED |
Definition at line 1279 of file MDB2.php.
Referenced by MDB2_Result_oci8\fetchRow(), MDB2_Result_pgsql\fetchRow(), MDB2_Result_mysql\fetchRow(), MDB2_Result_mysqli\fetchRow(), and MDB2_BufferedResult_oci8\fetchRow().
MDB2_Driver_Common::$identifier_quoting = array('start' => '"', 'end' => '"', 'escape' => '"') |
MDB2_Driver_Common::$limit = 0 |
Definition at line 1251 of file MDB2.php.
Referenced by MDB2_Driver_pgsql\_modifyManipQuery(), MDB2_Driver_oci8\_modifyQuery(), MDB2_Driver_mysql\_modifyQuery(), MDB2_Driver_mysqli\_modifyQuery(), MDB2_Driver_pgsql\_modifyQuery(), MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), MDB2_Driver_mysqli\prepare(), MDB2_Driver_oci8\standaloneExec(), MDB2_Driver_oci8\standaloneQuery(), and MDB2_Driver_pgsql\standaloneQuery().
MDB2_Driver_Common::$offset = 0 |
Definition at line 1244 of file MDB2.php.
Referenced by MDB2_Driver_oci8\_modifyQuery(), MDB2_Driver_oci8\prepare(), MDB2_Driver_pgsql\prepare(), MDB2_Driver_mysql\prepare(), MDB2_Driver_mysqli\prepare(), MDB2_Driver_oci8\standaloneExec(), MDB2_Driver_oci8\standaloneQuery(), and MDB2_Driver_pgsql\standaloneQuery().
MDB2_Driver_Common::$opened_persistent |
Definition at line 1031 of file MDB2.php.
Referenced by MDB2_Driver_oci8\disconnect(), MDB2_Driver_pgsql\disconnect(), MDB2_Driver_mysql\disconnect(), and MDB2_Driver_mysqli\disconnect().
MDB2_Driver_Common::$phptype |
Definition at line 1258 of file MDB2.php.
Referenced by MDB2_Driver_mysqli\connect(), MDB2_Driver_mysql\connect(), MDB2_Driver_oci8\connect(), and MDB2_Driver_pgsql\connect().
MDB2_Driver_Common::$sql_comments |
MDB2_Driver_Common::$supported |