| 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
connect.inc DB.php dbase.php errors.inc fbsql.php fetchmodes.inc fetchmode_object.inc ibase.php ifx.php include.inc limit.inc mktable.inc msql.php mssql.php multiconnect.php mysql.php mysqli.php numcols.inc numrows.inc oci8.php odbc.php pgsql.php prepexe.inc sequences.inc simplequery.inc skipif.inc skipif.inc sqlite.php storage.php sybase.php transactions.inc |
[ Top ] $prepared_queries = array()[line 115] The prepared queries
[ Top ] $prepare_tokens = array()[line 103] The elements from each prepared statement
[ Top ] $prepare_types = array()[line 109] The data types of the various elements in each prepared statement
[ Top ] Method DetailDB_common (Constructor) [line 126]affectedRows [line 1693]
Determines the number of rows affected by a data maniuplation query
Overridden in child classes as:
[ Top ]
autoCommit [line 1637]
Enables or disables automatic commits
Overridden in child classes as:
Parameters:
[ Top ]
autoExecute [line 825]
Automaticaly generates an insert or update query and call prepare() and execute() with it
Parameters:
[ Top ]
autoPrepare [line 796]
Automaticaly generates an insert or update query and pass it to prepare()
Parameters:
[ Top ]
buildManipSQL [line 869]
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 1650]
Commits the current transaction
Overridden in child classes as:
[ Top ]
createSequence [line 1762]
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 1780]
Deletes a sequence
Overridden in child classes as:
Parameters:
[ Top ]
errorCode [line 1870]
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 1892]
Maps a DB error code to a textual message
Parameters:
[ Top ]
errorNative [line 1851]
Gets the DBMS' native error code produced by the last query
Overridden in child classes as:
[ Top ]
escapeSimple [line 449]
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 942]
Executes a DB statement prepared with prepare() Example 1.
Overridden in child classes as:
Parameters:
[ Top ]
executeEmulateQuery [line 977]
Emulates executing prepared statements if the DBMS not support them
Parameters:
[ Top ]
executeMultiple [line 1031]
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 1057]
Frees the internal resources associated with a prepared query
Overridden in child classes as:
Parameters:
[ Top ]
getAll [line 1569]
Fetches all of the rows from a query result
Parameters:
[ Top ]
getAssoc [line 1462]
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 1331]
Fetches a single column from a query result and returns it as an indexed array
Parameters:
[ Top ]
getListOf [line 2059]
Lists internal database information
Parameters:
[ Top ]
getOne [line 1213]
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 690]
Returns the value of an option
Parameters:
[ Top ]
getRow [line 1263]
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 1715]
Generates the name used inside the database for a sequence The createSequence() docblock contains notes about storing sequence names.
Parameters:
[ Top ]
getSpecialQuery [line 2090]
Obtains the query string needed for listing a given type of objects
Overridden in child classes as:
Parameters:
[ Top ]
getTables [line 2040]
Lists the tables in the current database
[ Top ]
limitQuery [line 1181]
Generates and executes a LIMIT query
Parameters:
[ Top ]
modifyLimitQuery [line 1112]
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 1085]
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 1737]
Returns the next free id in a sequence
Overridden in child classes as:
Parameters:
[ Top ]
numRows [line 1678]
Determines the number of rows in a query result
Overridden in child classes as:
Parameters:
[ Top ]
prepare [line 744]
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 464]
Tells whether the present driver supports a given feature
Parameters:
[ Top ]
query [line 1140]
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 263]
DEPRECATED: Quotes a string so it can be safely used in a query
Overridden in child classes as: Parameters:
[ Top ]
quoteIdentifier [line 309]
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 418]
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 240]
DEPRECATED: Quotes a string so it can be safely used within string delimiters in a query
Parameters:
[ Top ]
raiseError [line 1812]
Communicates an error and invoke error callbacks, etc Basically a wrapper for PEAR::raiseError without the message string.
Parameters:
[ Top ]
rollback [line 1663]
Reverts the current transaction
Overridden in child classes as:
[ Top ]
setFetchMode [line 490]
Sets the fetch mode that should be used by default for query results Parameters:
[ Top ]
setOption [line 645]
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 2020]
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 221]
DEPRECATED: String conversion method
[ Top ]
_convertNullArrayValuesToEmpty [line 2128]
Converts all null values in an array to empty strings
Parameters:
[ Top ]
_rtrimArrayValues [line 2107]
Right-trims all strings in an array
Parameters:
[ Top ]
Documentation generated on Tue, 22 Feb 2005 11:00:30 -0500 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004. |