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_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 ] $phptype =[line 58] DB type (mysql, oci8, odbc etc.)
[ Top ] $prepared_queries =[line 73]
[ Top ] $prepare_maxstmt = 0[line 78]
[ Top ] $prepare_tokens =[line 63]
[ Top ] $prepare_types =[line 68]
[ Top ] Method DetailDB_common (Constructor) [line 149]affectedRows [line 1681]
Returns the affected rows of a query
Overridden in child classes as:
[ Top ]
autoCommit [line 1619]
enable automatic Commit
Overridden in child classes as:
Parameters:
[ Top ]
autoExecute [line 847]
Automaticaly generate an insert or update query and call prepare() and execute() with it
Parameters:
[ Top ]
autoPrepare [line 826]
Automaticaly generate an insert or update query and pass it to prepare()
Parameters:
[ Top ]
buildManipSQL [line 875]
Make automaticaly an sql query for prepare() Example : buildManipSQL('table_sql', array('field1', 'field2', 'field3'), DB_AUTOQUERY_INSERT) will return the string : INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?) NB : - This belongs more to a SQL Builder class, but this is a simple facility
Parameters:
[ Top ]
commit [line 1634]
starts a Commit
Overridden in child classes as:
[ Top ]
createSequence [line 1767]
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 1786]
Deletes a sequence
Overridden in child classes as:
Parameters:
[ Top ]
errorCode [line 416]
Map native error codes to DB's portable ones Requires that the DB implementation's constructor fills in the $errorcode_map property.
Overridden in child classes as:
Parameters:
[ Top ]
errorMessage [line 439]
Map a DB error code to a textual message. This is actually just a wrapper for DB::errorMessage()
Parameters:
[ Top ]
errorNative [line 1696]
Returns an errormessage, provides by the database
Overridden in child classes as:
[ Top ]
escapeSimple [line 379]
Escape 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 947]
Executes a DB statement prepared with prepare() Example 1.
Overridden in child classes as:
Parameters:
[ Top ]
executeMultiple [line 1038]
This function does 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 1058]
Free the resource used in a prepared query
Overridden in child classes as:
Parameters:
[ Top ]
getAll [line 1550]
Fetch all the rows returned from a query
Parameters:
[ Top ]
getAssoc [line 1443]
Fetch the entire result set of a query and return 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 1320]
Fetch a single column from a result set and return it as an indexed array
Parameters:
[ Top ]
getListOf [line 1949]
list internal DB info valid values for $type are db dependent, often: databases, users, view, functions
Parameters:
[ Top ]
getOne [line 1203]
Fetch the first column of the first row of data returned from a query Takes care of doing the query and freeing the results when finished.
Parameters:
[ Top ]
getOption [line 724]
Returns the value of an option
Parameters:
[ Top ]
getRow [line 1251]
Fetch the first row of data returned from a query Takes care of doing the query and freeing the results when finished.
Parameters:
[ Top ]
getSpecialQuery [line 1974]
Returns the query needed to get some backend info
Overridden in child classes as:
Parameters:
[ Top ]
getTables [line 1930]limitQuery [line 1169]
Generates a limited query
Parameters:
[ Top ]
nextId [line 1740]
Returns the next free id in a sequence
Overridden in child classes as:
Parameters:
[ Top ]
numRows [line 1666]
Returns the number of rows in a result object
Overridden in child classes as:
Parameters:
[ Top ]
prepare [line 778]
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 394]
Tell whether a DB implementation or its backend extension supports a given feature
Parameters:
[ Top ]
query [line 1133]
Send a query to the database and return any results with a DB_result object 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 191]
DEPRECATED: Quotes a string so it can be safely used in a query
Overridden in child classes as: Parameters:
[ Top ]
quoteIdentifier [line 236]
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:
Overridden in child classes as:
Parameters:
[ Top ]
quoteSmart [line 347]
Format 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 167]
DEPRECATED: Quotes a string so it can be safely used within string delimiters in a query
Parameters:
[ Top ]
raiseError [line 476]
Communicate an error and invoke error callbacks, etc Basically a wrapper for PEAR::raiseError without the message string.
Parameters:
[ Top ]
rollback [line 1649]
starts a rollback
Overridden in child classes as:
[ Top ]
setFetchMode [line 530]
Sets which fetch mode should be used by default on queries on this connection
Parameters:
[ Top ]
setOption [line 679]
Set 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_NULL_TO_EMPTY convert null values to empty strings in data output by get*() and fetch*(). Needed because Oracle considers empty strings to be null, while most other DBMS's know the difference between empty and null. 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 1914]
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 ]
Documentation generated on Mon, 11 Mar 2019 10:14:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004. |