MDB2
[ class tree: MDB2 ] [ index: MDB2 ] [ all elements ]

Class: MDB2_Driver_Common

Source Location: /MDB2-2.0.0beta2/MDB2.php

Class Overview

PEAR
   |
   --MDB2_Driver_Common

MDB2_Driver_Common: Base class that is extended by each MDB2 driver


Author(s):

Variables

Methods


Child classes:

MDB2_Driver_ibase
MDB2 FireBird/InterBase driver
MDB2_Driver_mysql
MDB2 MySQL driver
MDB2_Driver_querysim
MDB2 QuerySim driver
MDB2_Driver_fbsql
MDB2 FrontBase driver
MDB2_Driver_oci8
MDB2 OCI8 driver
MDB2_Driver_pgsql
MDB2 PostGreSQL driver
MDB2_Driver_sqlite
MDB2 SQLite driver
MDB2_Driver_mssql
MDB2 MSSQL Server driver
MDB2_xxx
MDB2 XXX driver

Inherited Variables

Inherited Methods


Class Details

[line 770]
MDB2_Driver_Common: Base class that is extended by each MDB2 driver


[ Top ]


Class Variables

$auto_commit =  true

[line 890]

determine if queries should auto commit or not
  • Access: public

Type:   boolean


[ Top ]

$db_index =  0

[line 778]

index of the MDB2 object within the $GLOBALS['_MDB2_databases'] array
  • Access: public

Type:   integer


[ Top ]

$debug_output =  ''

[line 883]

string with the debugging information
  • Access: public

Type:   string


[ Top ]

$last_query =  ''

[line 939]

the last query sent to the driver
  • Access: public

Type:   string


[ Top ]

$options = array(
            'result_class' => 'MDB2_Result_%s',
            'buffered_result_class' => 'MDB2_BufferedResult_%s',
            'result_wrap_class' => false,
            'result_buffering' => true,
            'persistent' => false,
            'debug' => 0,
            'debug_handler' => 'MDB2_defaultDebugOutput',
            'lob_buffer_length' => 8192,
            'log_line_break' => "\n",
            'seqname_format' => '%s_seq',
            'seqname_col_name' => 'sequence',
            'use_transactions' => false,
            'decimal_places' => 2,
            'portability' => MDB2_PORTABILITY_ALL,
        )

[line 847]

$options['result_class'] -> class used for result sets

$options['buffered_result_class'] -> class used for buffered result sets $options['result_wrap_class'] -> class used to wrap result sets into $options['result_buffering'] -> boolean should results be buffered or not? $options['persistent'] -> boolean persistent connection? $options['debug'] -> integer numeric debug level $options['debug_handler'] -> string function/meothd that captures debug messages $options['lob_buffer_length'] -> integer LOB buffer length $options['log_line_break'] -> string line-break format $options['seqname_format'] -> string pattern for sequence name $options['sequence_col_name'] -> string sequence column name $options['use_transactions'] -> boolean $options['decimal_places'] -> integer $options['portability'] -> portability constant

  • Access: public

Type:   array


[ Top ]

$supported = array()

[line 827]

list of all supported features of the given driver
  • Access: public

Type:   array


[ Top ]



Method Detail

MDB2_Driver_Common (Constructor)   [line 982]

MDB2_Driver_Common MDB2_Driver_Common( )

Constructor

[ Top ]

affectedRows   [line 2106]

mixed affectedRows( )

returns the affected rows of a query
  • Return: MDB2 Error Object or number of rows
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::affectedRows()
returns the affected rows of a query
MDB2_Driver_mysql::affectedRows()
returns the affected rows of a query
MDB2_Driver_fbsql::affectedRows()
returns the affected rows of a query
MDB2_Driver_sqlite::affectedRows()
returns the affected rows of a query
MDB2_Driver_mssql::affectedRows()
returns the affected rows of a query

[ Top ]

autoCommit   [line 1387]

mixed autoCommit( boolean $auto_commit)

Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_Driver_mysql::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_Driver_fbsql::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_Driver_oci8::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_Driver_pgsql::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_Driver_sqlite::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_Driver_mssql::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.
MDB2_xxx::autoCommit()
Define whether database changes done on the database be automatically committed. This function may also implicitly start or end a transaction.

Parameters:

boolean   $auto_commit   —  flag that indicates whether the database changes should be committed right after executing every query statement. If this argument is 0 a transaction implicitly started. Otherwise, if a transaction is in progress it is ended by committing any database changes that were pending.

[ Top ]

commit   [line 1406]

mixed commit( )

Commit the database changes done during a transaction 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 committing the pending changes.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_Driver_mysql::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_Driver_fbsql::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_Driver_oci8::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_Driver_pgsql::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_Driver_sqlite::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_Driver_mssql::commit()
Commit the database changes done during a transaction 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 committing the pending changes.
MDB2_xxx::commit()
Commit the database changes done during a transaction 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 committing the pending changes.

[ Top ]

currID   [line 2267]

mixed currID( string $seq_name)

returns the current id of a sequence
  • Return: MDB2 Error Object or id
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::currID()
returns the current id of a sequence
MDB2_Driver_mysql::currID()
returns the current id of a sequence
MDB2_Driver_fbsql::currID()
returns the current id of a sequence
MDB2_Driver_pgsql::currID()
returns the current id of a sequence
MDB2_Driver_sqlite::currID()
returns the current id of a sequence
MDB2_xxx::currID()
returns the current id of a sequence

Parameters:

string   $seq_name   —  name of the sequence

[ Top ]

debug   [line 1205]

void debug( string $message, [ $scope = ''])

set a debug message
  • Access: public

Parameters:

string   $message   —  Message with information for the user.
   $scope   — 

[ Top ]

debugOutput   [line 1221]

string debugOutput( )

output debug info
  • Return: content of the debug_output class variable
  • Access: public

[ Top ]

disconnect   [line 1442]

mixed disconnect( )

Log out and disconnect from the database.
  • Return: true on success, false if not connected and error object on error
  • Access: public

[ Top ]

errorInfo   [line 1020]

array errorInfo( [integer $error = null])

This method is used to collect information about an error
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::errorInfo()
This method is used to collect information about an error
MDB2_Driver_mysql::errorInfo()
This method is used to collect information about an error
MDB2_Driver_fbsql::errorInfo()
This method is used to collect information about an error
MDB2_Driver_oci8::errorInfo()
This method is used to collect information about an error
MDB2_Driver_pgsql::errorInfo()
This method is used to collect information about an error
MDB2_Driver_sqlite::errorInfo()
This method is used to collect information about an error
MDB2_Driver_mssql::errorInfo()
This method is used to collect information about an error
MDB2_xxx::errorInfo()
This method is used to collect information about an error

Parameters:

integer   $error   — 

[ Top ]

errorNative   [line 1092]

mixed errorNative( )

returns an errormessage, provides by the database
  • Return: MDB2 Error Object or message
  • Access: public

[ Top ]

escape   [line 1237]

string escape( string $text)

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.
  • Return: quoted string
  • Access: public

Overridden in child classes as:

MDB2_Driver_mysql::escape()
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.
MDB2_Driver_sqlite::escape()
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.

Parameters:

string   $text   —  the input string to quote

[ Top ]

execute   [line 2019]

mixed &execute( int $prepared_query, [array $types = null], [mixed $result_class = false], [mixed $result_wrap_class = false])

Execute a prepared query statement.
  • Return: a result handle or MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $prepared_query   —  argument is a handle that was returned by the function prepare()
array   $types   —  array that contains the types of the columns in the result set
mixed   $result_class   —  string which specifies which result class to use
mixed   $result_wrap_class   —  string which specifies which class to wrap results in

[ Top ]

executeMultiple   [line 2456]

mixed executeMultiple( resource $prepared_query, [array $types = null], [array $params = null])

This function does several executeParams() calls on the same statement handle.

$params must be an array indexed numerically from 0, one execute call is done for every 'row' in the array.

If an error occurs during executeParams(), executeMultiple() does not execute the unfinished rows, but rather returns that error.


Parameters:

resource   $prepared_query   —  query handle from prepare()
array   $types   —  array that contains the types of the columns in the result set
array   $params   —  numeric array containing the data to insert into the query

[ Top ]

executeParams   [line 2427]

mixed &executeParams( resource $prepared_query, [array $types = null], [array $params = false], [mixed $result_class = false], [mixed $result_wrap_class = false])

Executes a prepared SQL query

With executeParams() the generic query of prepare is assigned with the given data array. The values of the array inserted into the query in the same order like the array order


Parameters:

resource   $prepared_query   —  query handle from prepare()
array   $types   —  array that contains the types of the columns in the result set
array   $params   —  numeric array containing the data to insert into the query
mixed   $result_class   —  string which specifies which result class to use
mixed   $result_wrap_class   —  string which specifies which class to wrap results in

[ Top ]

freePrepared   [line 1971]

mixed freePrepared( int $prepared_query)

Release resources allocated for the specified prepared query.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $prepared_query   —  argument is a handle that was returned by the function prepare()

[ Top ]

getDeclaration   [line 2194]

string getDeclaration( string $type, string $name, string $field)

Obtain DBMS specific SQL code portion needed to declare of the given type
  • Return: DBMS specific SQL code portion that should be used to declare the specified field.
  • Access: public

Parameters:

string   $type   —  type to which the value should be converted to
string   $name   —  name the field to be declared.
string   $field   —  definition of the field

[ Top ]

getDSN   [line 1526]

mixed getDSN( [string $type = 'string'])

return the DSN as a string
  • Return: DSN in the chosen type
  • Access: public

Parameters:

string   $type   —  type to return

[ Top ]

getOption   [line 1187]

mixed getOption( string $option)

returns the value of an option
  • Return: the option value or error object
  • Access: public

Parameters:

string   $option   —  option name

[ Top ]

getSequenceName   [line 2232]

string getSequenceName( string $sqn)

adds sequence name formating to a sequence name
  • Return: formatted sequence name
  • Access: public

Parameters:

string   $sqn   —  name of the sequence

[ Top ]

getWarnings   [line 1121]

array getWarnings( )

get all warnings in reverse order.

This means that the last warning is the first element in the array


[ Top ]

loadModule   [line 1340]

object on &loadModule( string $module, [string $property = null])

loads a module
  • Return: success a reference to the given module is returned and on failure a PEAR error
  • Access: public

Parameters:

string   $module   —  name of the module that should be loaded (only used for error messages)
string   $property   —  name of the property into which the class will be loaded

[ Top ]

nextID   [line 2251]

mixed nextID( string $seq_name, [boolean $ondemand = false])

returns the next free id of a sequence
  • Return: MDB2 Error Object or id
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::nextID()
returns the next free id of a sequence
MDB2_Driver_mysql::nextID()
returns the next free id of a sequence
MDB2_Driver_fbsql::nextID()
returns the next free id of a sequence
MDB2_Driver_oci8::nextID()
returns the next free id of a sequence
MDB2_Driver_pgsql::nextID()
returns the next free id of a sequence
MDB2_Driver_sqlite::nextID()
returns the next free id of a sequence
MDB2_Driver_mssql::nextID()
returns the next free id of a sequence
MDB2_xxx::nextID()
returns the next free id of a sequence

Parameters:

string   $seq_name   —  name of the sequence
boolean   $ondemand   —  when true the seqence is automatic created, if it not exists

[ Top ]

prepare   [line 1813]

mixed prepare( string $query, [array $types = null])

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(?,?,?)'. The ? are wildcards. Types of wildcards: ? - a quoted scalar value, i.e. strings, integers


Parameters:

string   $query   —  the query to prepare
array   $types   —  array thats specifies the types of the fields

[ Top ]

query   [line 1598]

mixed &query( string $query, [mixed $types = null], [mixed $result_class = false], [mixed $result_wrap_class = false])

Send a query to the database and return any results
  • Return: a result handle or MDB2_OK on success, a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::query()
Send a query to the database and return any results
MDB2_Driver_mysql::query()
Send a query to the database and return any results
MDB2_Driver_querysim::query()
Get QuerySim text from appropriate source and return the parsed text.
MDB2_Driver_fbsql::query()
Send a query to the database and return any results
MDB2_Driver_oci8::query()
Send a query to the database and return any results
MDB2_Driver_pgsql::query()
Send a query to the database and return any results
MDB2_Driver_sqlite::query()
Send a query to the database and return any results
MDB2_Driver_mssql::query()
Send a query to the database and return any results
MDB2_xxx::query()
Send a query to the database and return any results

Parameters:

string   $query   —  the SQL query
mixed   $types   —  array that contains the types of the columns in the result set
mixed   $result_class   —  string which specifies which result class to use
mixed   $result_wrap_class   —  string which specifies which class to wrap results in

[ Top ]

queryAll   [line 2394]

mixed queryAll( string $query, [array $types = null], [int $fetchmode = MDB2_FETCHMODE_DEFAULT], [boolean $rekey = false], [boolean $force_array = false], [boolean $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.
  • Return: MDB2_OK or data array on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $query   —  the SELECT query statement to be executed.
array   $types   —  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   $fetchmode   —  how the array data should be indexed
boolean   $rekey   —  if set to true, the $all will have the first column as its first dimension
boolean   $force_array   —  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.
boolean   $group   —  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.

[ Top ]

queryCol   [line 2357]

mixed queryCol( string $query, [string $type = null], [int $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.
  • Return: MDB2_OK or data array on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $query   —  the SELECT query statement to be executed.
string   $type   —  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   $colnum   —  the row number to fetch

[ Top ]

queryOne   [line 2300]

mixed queryOne( string $query, [string $type = null])

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.
  • Return: MDB2_OK or field value on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $query   —  the SELECT query statement to be executed.
string   $type   —  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

[ Top ]

queryRow   [line 2329]

mixed queryRow( string $query, [array $types = null], [int $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.
  • Return: MDB2_OK or data array on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $query   —  the SELECT query statement to be executed.
array   $types   —  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   $fetchmode   —  how the array data should be indexed

[ Top ]

quote   [line 2131]

string quote( string $value, [string $type = null])

Convert a text value into a DBMS specific format that is suitable to compose query statements.
  • Return: text string that represents the given argument value in a DBMS specific format.
  • Access: public

Parameters:

string   $value   —  text string value that is intended to be converted.
string   $type   —  type to which the value should be converted to

[ Top ]

quoteIdentifier   [line 1284]

string quoteIdentifier( string $str)

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:

  • backtick (`) -- due to MySQL
  • double quote (") -- due to Oracle
  • brackets ([ or ]) -- due to Access
Delimited identifiers are known to generally work correctly under the following drivers:
  • mssql
  • mysql
  • mysqli
  • oci8
  • odbc(access)
  • odbc(db2)
  • pgsql
  • sqlite
  • sybase
InterBase doesn't seem to be able to use delimited identifiers via PHP 4. They work fine under PHP 5.

  • Return: quoted identifier string
  • Access: public

Overridden in child classes as:

MDB2_Driver_mysql::quoteIdentifier()
Quote a string so it can be safely used as a table or column name
MDB2_Driver_mssql::quoteIdentifier()
Quote a string so it can be safely used as a table / column name

Parameters:

string   $str   —  identifier name to be quoted

[ Top ]

raiseError   [line 1053]

object a &raiseError( [mixed $code = null], [int $mode = null], [mixed $options = null], [string $userinfo = null])

This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string.
  • Return: PEAR error object
  • See: PEAR_Error

Parameters:

mixed   $code   —  integer error code, or a PEAR error object (all other parameters are ignored if this parameter is an object
int   $mode   —  error mode, see PEAR_Error docs
mixed   $options   —  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   $userinfo   —  Extra debug information. Defaults to the last query and native error code.

[ Top ]

replace   [line 1728]

mixed replace( string $table, array $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 pratically only MySQL implements it natively, this type of query is emulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.

  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_mysql::replace()
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.
MDB2_Driver_sqlite::replace()
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.
MDB2_xxx::replace()
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.

Parameters:

string   $table   —  name of the table on which the REPLACE query will be executed.
array   $fields   — 

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 Metabase are supported except for clob and blob.

Default: no type conversion

null Boolean 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 Boolean 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


[ Top ]

resetWarnings   [line 1105]

void resetWarnings( )

reset the warning array
  • Access: public

[ Top ]

rollback   [line 1425]

mixed rollback( )

Cancel any database changes done during a transaction 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.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_ibase::rollback()
Cancel any database changes done during a transaction 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.
MDB2_Driver_mysql::rollback()
Cancel any database changes done during a transaction 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.
MDB2_Driver_fbsql::rollback()
Cancel any database changes done during a transaction 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.
MDB2_Driver_oci8::rollback()
Cancel any database changes done during a transaction 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.
MDB2_Driver_pgsql::rollback()
Cancel any database changes done during a transaction 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.
MDB2_Driver_sqlite::rollback()
Cancel any database changes done during a transaction 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.
MDB2_Driver_mssql::rollback()
Cancel any database changes done during a transaction 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.
MDB2_xxx::rollback()
Cancel any database changes done during a transaction 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.

[ Top ]

setDatabase   [line 1477]

string setDatabase( string $name)

Select a different database
  • Return: name of the database previously connected to
  • Access: public

Parameters:

string   $name   —  name of the database that should be selected

[ Top ]

setDSN   [line 1494]

MDB2_OK setDSN( mixed $dsn)

set the DSN
  • Access: public

Parameters:

mixed   $dsn   —  DSN string or array

[ Top ]

setFetchMode   [line 1140]

void setFetchMode( integer $fetchmode)

Sets which fetch mode should be used by default on queries on this connection.

Parameters:

integer   $fetchmode   —  MDB2_FETCHMODE_ORDERED or MDB2_FETCHMODE_ASSOC, possibly bit-wise OR'ed with MDB2_FETCHMODE_FLIPPED.

[ Top ]

setLimit   [line 1617]

mixed setLimit( string $limit, [string $offset = null])

set the range of the next query
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

string   $limit   —  number of rows to select
string   $offset   —  first row to select

[ Top ]

setOption   [line 1163]

mixed setOption( string $option, mixed $value)

set the option for the db class
  • Return: MDB2_OK or MDB2 Error Object
  • Access: public

Parameters:

string   $option   —  option name
mixed   $value   —  value for the option

[ Top ]

setParam   [line 1916]

mixed setParam( int $prepared_query, int $parameter, mixed $value)

Set the value of a parameter of a prepared query.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $prepared_query   —  argument is a handle that was returned by the function prepare()
int   $parameter   —  the order number of the parameter in the query statement. The order number of the first parameter is 1.
mixed   $value   —  value that is meant to be assigned to specified parameter. The type of the value depends on the $type argument.

[ Top ]

setParamArray   [line 1949]

mixed setParamArray( int $prepared_query, array $params)

Set the values of multiple a parameter of a prepared query in bulk.

Parameters:

int   $prepared_query   —  argument is a handle that was returned by the function prepare()
array   $params   —  array thats specifies all necessary infromation for setParam() the array elements must use keys corresponding to the number of the position of the parameter.

[ Top ]

standaloneQuery   [line 1563]

mixed standaloneQuery( string $query)

execute a query as database administrator
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_oci8::standaloneQuery()
execute a query as DBA
MDB2_Driver_pgsql::standaloneQuery()
execute a query as DBA
MDB2_Driver_mssql::standaloneQuery()
execute a query as DBA

Parameters:

string   $query   —  the SQL query

[ Top ]

subSelect   [line 1655]

string subSelect( string $query, [string $type = false])

simple subselect emulation: leaves the query untouched for all RDBMS that support subselects
  • Return: the query
  • Access: public

Overridden in child classes as:

MDB2_Driver_mysql::subSelect()
simple subselect emulation for Mysql
MDB2_xxx::subSelect()
simple subselect emulation for Mysql

Parameters:

string   $query   —  the SQL query for the subselect that may only return a column
string   $type   —  determines type of the field

[ Top ]

supports   [line 2217]

boolean supports( string $feature)

Tell whether a DB implementation or its backend extension supports a given feature.
  • Return: whether this DB implementation supports $feature
  • Access: public

Parameters:

string   $feature   —  name of the feature (see the MDB2 class doc)

[ Top ]

__toString   [line 1000]

string __toString( )

String conversation
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 10:15:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.