DB |
[ class tree: DB ] [ index: DB ] [ all elements ] |
Packages: DB Classes:
DB
Files:DB_common DB_dbase DB_Error DB_fbsql DB_ibase DB_ifx DB_msql DB_mssql DB_mysql DB_mysqli DB_oci8 DB_odbc DB_pgsql DB_result DB_row DB_sqlite DB_storage DB_sybase
common.php
DB.php dbase.php fbsql.php ibase.php ifx.php msql.php mssql.php mysql.php mysqli.php oci8.php odbc.php pgsql.php sqlite.php storage.php sybase.php |
[ Top ] $prepared_queries = array()[line 122] The prepared queries
[ Top ] $prepare_tokens = array()[line 110] The elements from each prepared statement
[ Top ] $prepare_types = array()[line 116] The data types of the various elements in each prepared statement
[ Top ] $was_connected = null[line 71] Was a connection present when the object was serialized()?
[ Top ] $_last_query_manip = false[line 129] Flag indicating that the last query was a manipulation query.
[ Top ] $_next_query_manip = false[line 137] Flag indicating that the next query <em>must</em> be a manipulation query.
[ Top ] Method Detail__construct (Constructor) [line 148]
This constructor calls $this->PEAR('DB_Error') Overridden in child classes as:
[ Top ]
affectedRows [line 1756]
Determines the number of rows affected by a data maniuplation query
Overridden in child classes as:
[ Top ]
autoCommit [line 1700]
Enables or disables automatic commits
Overridden in child classes as:
Parameters:
[ Top ]
autoExecute [line 885]
Automaticaly generates an insert or update query and call prepare() and execute() with it
Parameters:
[ Top ]
autoPrepare [line 853]
Automaticaly generates an insert or update query and pass it to prepare()
Parameters:
[ Top ]
buildManipSQL [line 932]
Produces an SQL query string for autoPrepare() Example: buildManipSQL('table_sql', array('field1', 'field2', 'field3'), DB_AUTOQUERY_INSERT); That returns INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?) NOTES:
Parameters:
[ Top ]
commit [line 1713]
Commits the current transaction
Overridden in child classes as:
[ Top ]
createSequence [line 1825]
Creates a new sequence The name of a given sequence is determined by passing the string provided in the $seq_name argument through PHP's sprintf() function using the value from the seqname_format option as the sprintf()'s format argument. seqname_format is set via setOption().
Overridden in child classes as:
Parameters:
[ Top ]
dropSequence [line 1843]
Deletes a sequence
Overridden in child classes as:
Parameters:
[ Top ]
errorCode [line 1938]
Maps native error codes to DB's portable ones Uses the $errorcode_map property defined in each driver.
Overridden in child classes as:
Parameters:
[ Top ]
errorMessage [line 1960]
Maps a DB error code to a textual message
Parameters:
[ Top ]
errorNative [line 1919]
Gets the DBMS' native error code produced by the last query
Overridden in child classes as:
[ Top ]
escapeSimple [line 509]
Escapes a string according to the current DBMS's standards In SQLite, this makes things safe for inserts/updates, but may cause problems when performing text comparisons against columns containing binary data. See the PHP manual for more info.
Overridden in child classes as:
Parameters:
[ Top ]
execute [line 1005]
Executes a DB statement prepared with prepare() Example 1.
Overridden in child classes as:
Parameters:
[ Top ]
executeEmulateQuery [line 1040]
Emulates executing prepared statements if the DBMS not support them
Parameters:
[ Top ]
executeMultiple [line 1094]
Performs several execute() calls on the same statement handle $data must be an array indexed numerically from 0, one execute call is done for every "row" in the array. If an error occurs during execute(), executeMultiple() does not execute the unfinished rows, but rather returns that error.
Parameters:
[ Top ]
freePrepared [line 1120]
Frees the internal resources associated with a prepared query
Overridden in child classes as:
Parameters:
[ Top ]
getAll [line 1632]
Fetches all of the rows from a query result
Parameters:
[ Top ]
getAssoc [line 1521]
Fetches an entire query result and returns it as an associative array using the first column as the key If the result set contains more than two columns, the value will be an array of the values from column 2-n. If the result set contains only two columns, the returned value will be a scalar with the value of the second column (unless forced to an array with the $force_array parameter). A DB error code is returned on errors. If the result set contains fewer than two columns, a DB_ERROR_TRUNCATED error is returned. For example, if the table "mytable" contains: ID TEXT DATE -------------------------------- 1 'one' 944679408 2 'two' 944679408 3 'three' 944679408 Then the call getAssoc('SELECT id,text FROM mytable') returns: array( '1' => 'one', '2' => 'two', '3' => 'three', ) ...while the call getAssoc('SELECT id,text,date FROM mytable') returns: array( '1' => array('one', '944679408'), '2' => array('two', '944679408'), '3' => array('three', '944679408') ) If the more than one row occurs with the same value in the first column, the last row overwrites all previous ones by default. Use the $group parameter if you don't want to overwrite like this. Example: getAssoc('SELECT category,id,name FROM mytable', false, null, DB_FETCHMODE_ASSOC, true) returns: array( '1' => array(array('id' => '4', 'name' => 'number four'), array('id' => '6', 'name' => 'number six') ), '9' => array(array('id' => '4', 'name' => 'number four'), array('id' => '6', 'name' => 'number six') ) ) Keep in mind that database functions in PHP usually return string values for results regardless of the database's internal type.
Parameters:
[ Top ]
getCol [line 1390]
Fetches a single column from a query result and returns it as an indexed array
Parameters:
[ Top ]
getListOf [line 2127]
Lists internal database information
Parameters:
[ Top ]
getOne [line 1276]
Fetches the first column of the first row from a query result Takes care of doing the query and freeing the results when finished.
Parameters:
[ Top ]
getOption [line 747]
Returns the value of an option
Parameters:
[ Top ]
getRow [line 1324]
Fetches the first row of data returned from a query result Takes care of doing the query and freeing the results when finished.
Parameters:
[ Top ]
getSequenceName [line 1778]
Generates the name used inside the database for a sequence The createSequence() docblock contains notes about storing sequence names.
Parameters:
[ Top ]
getSpecialQuery [line 2158]
Obtains the query string needed for listing a given type of objects
Overridden in child classes as:
Parameters:
[ Top ]
getTables [line 2108]
Lists the tables in the current database
[ Top ]
limitQuery [line 1244]
Generates and executes a LIMIT query
Parameters:
[ Top ]
modifyLimitQuery [line 1175]
Adds LIMIT clauses to a query string according to current DBMS standards It is defined here to assure that all implementations have this method defined.
Overridden in child classes as:
Parameters:
[ Top ]
modifyQuery [line 1148]
Changes a query string for various DBMS specific reasons It is defined here to ensure all drivers have this method available.
Overridden in child classes as:
Parameters:
[ Top ]
nextId [line 1800]
Returns the next free id in a sequence
Overridden in child classes as:
Parameters:
[ Top ]
nextQueryIsManip [line 2177]
Sets (or unsets) a flag indicating that the next query will be a manipulation query, regardless of the usual DB::isManip() heuristics.
Parameters:
[ Top ]
numRows [line 1741]
Determines the number of rows in a query result
Overridden in child classes as:
Parameters:
[ Top ]
prepare [line 801]
Prepares a query for multiple execution with execute() Creates a query that can be run multiple times. Each time it is run, the placeholders, if any, will be replaced by the contents of execute()'s $data argument. Three types of placeholders can be used:
Use backslashes to escape placeholder characters if you don't want them to be interpreted as placeholders: "UPDATE foo SET col=? WHERE col='over \& under'" With some database backends, this is emulated.
Overridden in child classes as:
Parameters:
[ Top ]
provides [line 524]
Tells whether the present driver supports a given feature
Parameters:
[ Top ]
query [line 1203]
Sends a query to the database server The query string can be either a normal statement to be sent directly to the server OR if $params are passed the query can have placeholders and it will be passed through prepare() and execute().
Overridden in child classes as: Parameters:
[ Top ]
quote [line 285]
DEPRECATED: Quotes a string so it can be safely used in a query
Parameters:
[ Top ]
quoteBoolean [line 471]
Formats a boolean value for use within a query in a locale-independent manner.
Overridden in child classes as:
Parameters:
[ Top ]
quoteFloat [line 487]
Formats a float value for use within a query in a locale-independent manner.
Overridden in child classes as:
Parameters:
[ Top ]
quoteIdentifier [line 330]
Quotes 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:
Overridden in child classes as:
Parameters:
[ Top ]
quoteSmart [line 439]
Formats input so it can be safely used in a query The output depends on the PHP data type of input and the database type being used.
Parameters:
[ Top ]
quoteString [line 262]
DEPRECATED: Quotes a string so it can be safely used within string delimiters in a query
Parameters:
[ Top ]
raiseError [line 1879]
Communicates an error and invoke error callbacks, etc Basically a wrapper for PEAR::raiseError without the message string.
Parameters:
[ Top ]
rollback [line 1726]
Reverts the current transaction
Overridden in child classes as:
[ Top ]
setFetchMode [line 547]
Sets the fetch mode that should be used by default for query results Parameters:
[ Top ]
setOption [line 702]
Sets run-time configuration options for PEAR DB Options, their data types, default values and description:
----------------------------------------- PORTABILITY MODES These modes are bitwised, so they can be combined using | and removed using ^. See the examples section below on how to do this. DB_PORTABILITY_NONE turn off all portability features This mode gets automatically turned on if the deprecated optimize option gets set to performance. DB_PORTABILITY_LOWERCASE convert names of tables and fields to lower case when using get*(), fetch*() and tableInfo() This mode gets automatically turned on in the following databases if the deprecated option optimize gets set to portability:
DB_PORTABILITY_RTRIM right trim the data output by get*() fetch*() DB_PORTABILITY_DELETE_COUNT force reporting the number of rows deleted Some DBMS's don't count the number of rows deleted when performing simple DELETE FROM tablename queries. This portability mode tricks such DBMS's into telling the count by adding WHERE 1=1 to the end of DELETE queries. This mode gets automatically turned on in the following databases if the deprecated option optimize gets set to portability:
DB_PORTABILITY_NUMROWS enable hack that makes numRows() work in Oracle This mode gets automatically turned on in the following databases if the deprecated option optimize gets set to portability:
DB_PORTABILITY_ERRORS makes certain error messages in certain drivers compatible with those from other DBMS's
DB_PORTABILITY_ALL turn on all portability features ----------------------------------------- Example 1. Simple setOption() example Example 2. Portability for lowercasing and trimming Example 3. All portability options except trimming
Parameters:
[ Top ]
tableInfo [line 2088]
Returns information about a table or a result set The format of the resulting array depends on which $mode you select. The sample output below is based on this query: SELECT tblFoo.fldID, tblFoo.fldPhone, tblBar.fldId FROM tblFoo JOIN tblBar ON tblFoo.fldId = tblBar.fldId
The flags element contains a space separated list of extra information about the field. This data is inconsistent between DBMS's due to the way each DBMS works.
Overridden in child classes as:
Parameters:
[ Top ]
toString [line 243]
DEPRECATED: String conversion method
[ Top ]
_checkManip [line 2197]
Checks if the given query is a manipulation query. This also takes into account the _next_query_manip flag and sets the _last_query_manip flag (and resets _next_query_manip) according to the result.
Overridden in child classes as:
Parameters:
[ Top ]
_convertNullArrayValuesToEmpty [line 2242]
Converts all null values in an array to empty strings
Parameters:
[ Top ]
_rtrimArrayValues [line 2221]
Right-trims all strings in an array
Parameters:
[ Top ]
__sleep [line 162]
Automatically indicates which properties should be saved when PHP's serialize() function is called
[ Top ]
__toString [line 221]
Automatic string conversion for PHP 5
[ Top ]
__wakeup [line 204]
Automatically reconnects to the database when PHP's unserialize() function is called The reconnection attempt is only performed if the object was connected at the time PHP's serialize() function was run. [ Top ]
Documentation generated on Mon, 11 Mar 2019 16:04:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004. |