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 ] Method DetailDB_common (Constructor) [line 133]affectedRows [line 1704]
Determines the number of rows affected by a data maniuplation query
Overridden in child classes as:
[ Top ]
autoCommit [line 1648]
Enables or disables automatic commits
Overridden in child classes as:
Parameters:
[ Top ]
autoExecute [line 832]
Automaticaly generates an insert or update query and call prepare() and execute() with it
Parameters:
[ Top ]
autoPrepare [line 803]
Automaticaly generates an insert or update query and pass it to prepare()
Parameters:
[ Top ]
buildManipSQL [line 876]
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 1661]
Commits the current transaction
Overridden in child classes as:
[ Top ]
createSequence [line 1773]
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 1791]
Deletes a sequence
Overridden in child classes as:
Parameters:
[ Top ]
errorCode [line 1881]
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 1903]
Maps a DB error code to a textual message
Parameters:
[ Top ]
errorNative [line 1862]
Gets the DBMS' native error code produced by the last query
Overridden in child classes as:
[ Top ]
escapeSimple [line 456]
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 949]
Executes a DB statement prepared with prepare() Example 1.
Overridden in child classes as:
Parameters:
[ Top ]
executeEmulateQuery [line 984]
Emulates executing prepared statements if the DBMS not support them
Parameters:
[ Top ]
executeMultiple [line 1038]
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 1064]
Frees the internal resources associated with a prepared query
Overridden in child classes as:
Parameters:
[ Top ]
getAll [line 1580]
Fetches all of the rows from a query result
Parameters:
[ Top ]
getAssoc [line 1473]
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 1342]
Fetches a single column from a query result and returns it as an indexed array
Parameters:
[ Top ]
getListOf [line 2070]
Lists internal database information
Parameters:
[ Top ]
getOne [line 1220]
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 697]
Returns the value of an option
Parameters:
[ Top ]
getRow [line 1272]
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 1726]
Generates the name used inside the database for a sequence The createSequence() docblock contains notes about storing sequence names.
Parameters:
[ Top ]
getSpecialQuery [line 2101]
Obtains the query string needed for listing a given type of objects
Overridden in child classes as:
Parameters:
[ Top ]
getTables [line 2051]
Lists the tables in the current database
[ Top ]
limitQuery [line 1188]
Generates and executes a LIMIT query
Parameters:
[ Top ]
modifyLimitQuery [line 1119]
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 1092]
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 1748]
Returns the next free id in a sequence
Overridden in child classes as:
Parameters:
[ Top ]
numRows [line 1689]
Determines the number of rows in a query result
Overridden in child classes as:
Parameters:
[ Top ]
prepare [line 751]
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 471]
Tells whether the present driver supports a given feature
Parameters:
[ Top ]
query [line 1147]
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 270]
DEPRECATED: Quotes a string so it can be safely used in a query
Overridden in child classes as: Parameters:
[ Top ]
quoteIdentifier [line 316]
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 425]
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.
Overridden in child classes as:
Parameters:
[ Top ]
quoteString [line 247]
DEPRECATED: Quotes a string so it can be safely used within string delimiters in a query
Parameters:
[ Top ]
raiseError [line 1823]
Communicates an error and invoke error callbacks, etc Basically a wrapper for PEAR::raiseError without the message string.
Parameters:
[ Top ]
rollback [line 1674]
Reverts the current transaction
Overridden in child classes as:
[ Top ]
setFetchMode [line 497]
Sets the fetch mode that should be used by default for query results Parameters:
[ Top ]
setOption [line 652]
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 2031]
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 228]
DEPRECATED: String conversion method
[ Top ]
_convertNullArrayValuesToEmpty [line 2139]
Converts all null values in an array to empty strings
Parameters:
[ Top ]
_rtrimArrayValues [line 2118]
Right-trims all strings in an array
Parameters:
[ Top ]
__sleep [line 147]
Automatically indicates which properties should be saved when PHP's serialize() function is called
[ Top ]
__toString [line 206]
Automatic string conversion for PHP 5
[ Top ]
__wakeup [line 189]
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 14:28:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004. |