ux_t3lib_DB Class Reference

Inheritance diagram for ux_t3lib_DB:

Inheritance graph
[legend]
Collaboration diagram for ux_t3lib_DB:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ux_t3lib_DB ()
 initInternalVariables ()
 clearCachedFieldInfo ()
 cacheFieldInfo ()
 analyzeFields ($parsedExtSQL)
 mapCachedFieldInfo ($fieldInfo)
 exec_INSERTquery ($table, $fields_values, $no_quote_fields='')
 exec_UPDATEquery ($table, $where, $fields_values, $no_quote_fields='')
 exec_DELETEquery ($table, $where)
 exec_SELECTquery ($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='')
 INSERTquery ($table, $fields_values, $no_quote_fields='')
 UPDATEquery ($table, $where, $fields_values, $no_quote_fields='')
 DELETEquery ($table, $where)
 SELECTquery ($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='')
 quoteSelectFields ($select_fields)
 quoteFieldNames ($select_fields)
 quoteFromTables ($from_table)
 quoteWhereClause ($where_clause)
 _quoteWhereClause ($where_clause)
 quoteGroupBy ($groupBy)
 quoteOrderBy ($orderBy)
 fullQuoteStr ($str, $table)
 quoteStr ($str, $table)
 MetaType ($type, $table, $max_length=-1)
 MySQLMetaType ($t)
 MySQLActualType ($meta)
 sql_error ()
 sql_errno ()
 sql_num_rows (&$res)
 sql_fetch_assoc (&$res)
 sql_fetch_row (&$res)
 sql_free_result (&$res)
 sql_insert_id ()
 sql_affected_rows ()
 sql_data_seek (&$res, $seek)
 sql_field_metatype ($table, $field)
 sql_field_type (&$res, $pointer)
 sql ($db, $query)
 sql_query ($query)
 sql_pconnect ($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password)
 sql_select_db ($TYPO3_db)
 admin_get_dbs ()
 admin_get_tables ()
 admin_get_fields ($tableName)
 admin_get_keys ($tableName)
 admin_query ($query)
 handler_getFromTableList ($tableList)
 handler_init ($handlerKey)
 runningNative ()
 runningADOdbDriver ($driver)
 map_needMapping ($tableList, $fieldMappingOnly=FALSE)
 map_assocArray ($input, $tables, $rev=FALSE)
 map_remapSELECTQueryParts (&$select_fields, &$from_table, &$where_clause, &$groupBy, &$orderBy)
 map_sqlParts (&$sqlPartArray, $defaultTable)
 map_genericQueryParsed (&$parsedQuery)
 map_fieldNamesInArray ($table, &$fieldArray)
 debugHandler ($function, $execTime, $inData)
 debug_WHERE ($table, $where, $script='')
 debug_log ($query, $ms, $data, $join, $errorFlag, $script='')
 debug_explain ($query)

Public Attributes

 $printErrors = false
 $debug = false
 $conf = array()
 $mapping = array()
 $table2handlerKeys = array()
 $handlerCfg
 $handlerInstance = array()
 $lastHandlerKey = ''
 $lastQuery = ''
 $lastParsedAndMappedQueryArray = array()
 $resourceIdToTableNameMap = array()
 $cache_handlerKeyFromTableList = array()
 $cache_mappingFromTableList = array()
 $cache_autoIncFields = array()
 $cache_fieldType = array()
 $cache_primaryKeys = array()
 $SQLparser
 $Installer

Detailed Description

Definition at line 127 of file class.ux_t3lib_db.php.


Member Function Documentation

ux_t3lib_DB::_quoteWhereClause ( where_clause  ) 

Quotes field names in a SQL WHERE clause acccording to DB rules

Parameters:
array $where_clause The parsed WHERE clause to quote
Returns:
array
See also:
quoteWhereClause()

Definition at line 1020 of file class.ux_t3lib_db.php.

References t3lib_div::inList(), and quoteFieldNames().

Referenced by quoteWhereClause().

ux_t3lib_DB::admin_get_dbs (  ) 

Listing databases from current MySQL connection. NOTICE: It WILL try to select those databases and thus break selection of current database. Use in Install Tool only! Usage count/core: 1

Returns:
array Each entry represents a database name

Reimplemented from t3lib_DB.

Definition at line 1679 of file class.ux_t3lib_db.php.

References $row, and sql_select_db().

ux_t3lib_DB::admin_get_fields ( tableName  ) 

Returns information about each field in the $table (quering the DBMS) In a DBAL this should look up the right handler for the table and return compatible information This function is important not only for the Install Tool but probably for DBALs as well since they might need to look up table specific information in order to construct correct queries. In such cases this information should probably be cached for quick delivery

Parameters:
string Table name
Returns:
array Field information in an associative array with fieldname => field row

Reimplemented from t3lib_DB.

Definition at line 1782 of file class.ux_t3lib_db.php.

References handler_getFromTableList(), map_needMapping(), MetaType(), and MySQLActualType().

ux_t3lib_DB::admin_get_keys ( tableName  ) 

Returns information about each index key in the $table (quering the DBMS) In a DBAL this should look up the right handler for the table and return compatible information

Parameters:
string Table name
Returns:
array Key information in a numeric array

Reimplemented from t3lib_DB.

Definition at line 1851 of file class.ux_t3lib_db.php.

References handler_getFromTableList(), and map_needMapping().

ux_t3lib_DB::admin_get_tables (  ) 

Returns the list of tables from the system (quering the DBMSs) It looks up all tables from the DBMS of the _DEFAULT handler and then add all tables *configured* to be managed by other handlers

When fetching the tables, it skips tables whose names begin with BIN$, as this is taken as a table coming from the "Recycle Bin" on Oracle.

Returns:
array Tables in an array (tablename is in both key and value)
Todo:
Should the check for Oracle Recycle Bin stuff be moved elsewhere?

Should return table details in value! see t3lib_db::admin_get_tables()

Reimplemented from t3lib_DB.

Definition at line 1720 of file class.ux_t3lib_db.php.

References $key, sql_error(), and sql_fetch_assoc().

ux_t3lib_DB::admin_query ( query  ) 

mysql() wrapper function, used by the Install Tool and EM for all queries regarding management of the database!

Parameters:
string Query to execute
Returns:
pointer Result pointer

Reimplemented from t3lib_DB.

Definition at line 1957 of file class.ux_t3lib_db.php.

References exec_INSERTquery(), handler_getFromTableList(), and map_genericQueryParsed().

ux_t3lib_DB::analyzeFields ( parsedExtSQL  ) 

Analyzes fields and adds the extracted information to the field type, auto increment and primary key info caches.

Parameters:
array $parsedExtSQL The output produced by t3lib_install::getFieldDefinitions_fileContent()
Returns:
void
See also:
t3lib_install::getFieldDefinitions_fileContent()

Definition at line 270 of file class.ux_t3lib_db.php.

References MySQLMetaType().

Referenced by cacheFieldInfo().

ux_t3lib_DB::cacheFieldInfo (  ) 

Definition at line 221 of file class.ux_t3lib_db.php.

References analyzeFields(), mapCachedFieldInfo(), and t3lib_div::writeFile().

Referenced by initInternalVariables().

ux_t3lib_DB::clearCachedFieldInfo (  ) 

Definition at line 216 of file class.ux_t3lib_db.php.

ux_t3lib_DB::debug_explain ( query  ) 

Perform EXPLAIN query on DEFAULT handler!

Parameters:
string SELECT Query
Returns:
array The Explain result rows in an array
Todo:
Not supporting other than the default handler? And what about DBMS of other kinds than MySQL - support for EXPLAIN?

Definition at line 2639 of file class.ux_t3lib_db.php.

References $res, $row, sql_fetch_assoc(), and sql_query().

Referenced by debugHandler().

ux_t3lib_DB::debug_log ( query,
ms,
data,
join,
errorFlag,
script = '' 
)

Insert row in the log table

Parameters:
string The current query
integer Execution time of query in milliseconds
array Data to be stored serialized.
string Join string if there IS a join.
integer Error status.
string $script The script calling the logging
Returns:
void

Definition at line 2606 of file class.ux_t3lib_db.php.

References $GLOBALS, and exec_INSERTquery().

Referenced by debugHandler().

ux_t3lib_DB::debug_WHERE ( table,
where,
script = '' 
)

Log the where clause for debugging purposes.

Parameters:
string $table Table name(s) the query was targeted at
string $where The WHERE clause to be logged
string $script The script calling the logging
Returns:
void

Definition at line 2583 of file class.ux_t3lib_db.php.

References $GLOBALS, and exec_INSERTquery().

Referenced by debugHandler().

ux_t3lib_DB::debugHandler ( function,
execTime,
inData 
)

Debug handler for query execution

Parameters:
string Function name from which this function is called.
string Execution time in ms of the query
array In-data of various kinds.
Returns:
void private

Definition at line 2502 of file class.ux_t3lib_db.php.

References debug_explain(), debug_log(), debug_WHERE(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), t3lib_div::inList(), and sql_error().

Referenced by exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), and exec_UPDATEquery().

ux_t3lib_DB::DELETEquery ( table,
where 
)

Creates a DELETE SQL-statement for $table where $where-clause Usage count/core: 3

Parameters:
string See exec_DELETEquery()
string See exec_DELETEquery()
Returns:
string Full SQL query for DELETE

Reimplemented from t3lib_DB.

Definition at line 875 of file class.ux_t3lib_db.php.

References debugOutput, quoteFromTables(), and quoteWhereClause().

Referenced by exec_DELETEquery().

ux_t3lib_DB::exec_DELETEquery ( table,
where 
)

Deletes records from table

Parameters:
string Database tablename
string WHERE clause, eg. "uid=1". NOTICE: You must escape values in this argument with $this->fullQuoteStr() yourself!
Returns:
mixed Result from handler

Reimplemented from t3lib_DB.

Definition at line 584 of file class.ux_t3lib_db.php.

References t3lib_DB::debug(), debugHandler(), DELETEquery(), handler_getFromTableList(), map_needMapping(), map_sqlParts(), t3lib_div::milliseconds(), and sql_error().

Referenced by debugHandler().

ux_t3lib_DB::exec_INSERTquery ( table,
fields_values,
no_quote_fields = '' 
)

Inserts a record for $table from the array with field/value pairs $fields_values.

Parameters:
string Table name
array Field values as key=>value pairs. Values will be escaped internally. Typically you would fill an array like "$insertFields" with 'fieldname'=>'value' and pass it to this function as argument.
mixed List/array of keys NOT to quote (eg. SQL functions)
Returns:
mixed Result from handler, usually TRUE when success and FALSE on failure

Reimplemented from t3lib_DB.

Definition at line 358 of file class.ux_t3lib_db.php.

References $content, t3lib_DB::debug(), debugHandler(), fullQuoteStr(), handler_getFromTableList(), INSERTquery(), map_assocArray(), map_needMapping(), t3lib_div::milliseconds(), quoteFromTables(), quoteWhereClause(), and sql_error().

Referenced by admin_query(), debug_log(), debug_WHERE(), and debugHandler().

ux_t3lib_DB::exec_SELECTquery ( select_fields,
from_table,
where_clause,
groupBy = '',
orderBy = '',
limit = '' 
)

Selects records from Data Source

Parameters:
string $select_fields List of fields to select from the table. This is what comes right after "SELECT ...". Required value.
string $from_table Table(s) from which to select. This is what comes right after "FROM ...". Required value.
string $where_clause Optional additional WHERE clauses put in the end of the query. NOTICE: You must escape values in this argument with $this->fullQquoteStr() yourself! DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
string $groupBy Optional GROUP BY field(s), if none, supply blank string.
string $orderBy Optional ORDER BY field(s), if none, supply blank string.
string $limit Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns:
mixed Result from handler. Typically object from DBAL layers.

Reimplemented from t3lib_DB.

Definition at line 650 of file class.ux_t3lib_db.php.

References t3lib_DB::debug(), debugHandler(), handler_getFromTableList(), t3lib_div::intExplode(), map_needMapping(), map_remapSELECTQueryParts(), t3lib_div::milliseconds(), SELECTquery(), and sql_error().

Referenced by debugHandler().

ux_t3lib_DB::exec_UPDATEquery ( table,
where,
fields_values,
no_quote_fields = '' 
)

Updates a record from $table

Parameters:
string Database tablename
string WHERE clause, eg. "uid=1". NOTICE: You must escape values in this argument with $this->fullQuoteStr() yourself!
array Field values as key=>value pairs. Values will be escaped internally. Typically you would fill an array like "$updateFields" with 'fieldname'=>'value' and pass it to this function as argument.
mixed List/array of keys NOT to quote (eg. SQL functions)
Returns:
mixed Result from handler, usually TRUE when success and FALSE on failure

Reimplemented from t3lib_DB.

Definition at line 493 of file class.ux_t3lib_db.php.

References $content, t3lib_DB::debug(), debugHandler(), fullQuoteStr(), handler_getFromTableList(), map_assocArray(), map_needMapping(), map_sqlParts(), t3lib_div::milliseconds(), quoteFromTables(), quoteWhereClause(), sql_error(), and UPDATEquery().

Referenced by debugHandler().

ux_t3lib_DB::fullQuoteStr ( str,
table 
)

Escaping and quoting values for SQL statements.

Parameters:
string Input string
string Table name for which to quote string. Just enter the table that the field-value is selected from (and any DBAL will look up which handler to use and then how to quote the string!).
Returns:
string Output string; Wrapped in single quotes and quotes in the string (" / ') and \ will be backslashed (or otherwise based on DBAL handler)
See also:
quoteStr()

Reimplemented from t3lib_DB.

Definition at line 1100 of file class.ux_t3lib_db.php.

Referenced by exec_INSERTquery(), exec_UPDATEquery(), INSERTquery(), and UPDATEquery().

ux_t3lib_DB::handler_getFromTableList ( tableList  ) 

Return the handler key pointing to an appropriate database handler as found in $this->handlerCfg array Notice: TWO or more tables in the table list MUST use the SAME handler key - otherwise a fatal error is thrown! (Logically, no database can possibly join two tables from separate sources!)

Parameters:
string Table list, eg. "pages" or "pages, tt_content" or "pages AS A, tt_content AS B"
Returns:
string Handler key (see $this->handlerCfg array) for table

Definition at line 2037 of file class.ux_t3lib_db.php.

References $key, and handler_init().

Referenced by admin_get_fields(), admin_get_keys(), admin_query(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), MetaType(), and quoteStr().

ux_t3lib_DB::handler_init ( handlerKey  ) 

Initialize handler (connecting to database)

Parameters:
string Handler key
Returns:
boolean If connection went well, return true
See also:
handler_getFromTableList()

Definition at line 2085 of file class.ux_t3lib_db.php.

References $GLOBALS, t3lib_DB::$link, t3lib_extMgm::extPath(), t3lib_div::getFileAbsFileName(), t3lib_div::makeInstance(), t3lib_div::sysLog(), and t3lib_div::trimExplode().

Referenced by handler_getFromTableList(), and sql_pconnect().

ux_t3lib_DB::initInternalVariables (  ) 

Setting internal variables from $this->conf

Returns:
void

Definition at line 203 of file class.ux_t3lib_db.php.

References cacheFieldInfo(), and t3lib_DB::debug().

Referenced by ux_t3lib_DB().

ux_t3lib_DB::INSERTquery ( table,
fields_values,
no_quote_fields = '' 
)

Creates an INSERT SQL-statement for $table from the array with field/value pairs $fields_values. Usage count/core: 4

Parameters:
string See exec_INSERTquery()
array See exec_INSERTquery()
mixed See exec_INSERTquery()
Returns:
mixed Full SQL query for INSERT as string or array (unless $fields_values does not contain any elements in which case it will be false). If BLOB fields will be affected and one is not running the native type, an array will be returned, where 0 => plain SQL, 1 => fieldname/value pairs of BLOB fields

Reimplemented from t3lib_DB.

Definition at line 736 of file class.ux_t3lib_db.php.

References debugOutput, fullQuoteStr(), quoteFieldNames(), runningNative(), and sql_field_metatype().

Referenced by exec_INSERTquery().

ux_t3lib_DB::map_assocArray ( input,
tables,
rev = FALSE 
)

Takes an associated array with field => value pairs and remaps the field names if configured for this table in $this->mapping array. Be careful not to map a field name to another existing fields name (although you can use this to swap fieldnames of course...:-) Observe mapping problems with join-results (more than one table): Joined queries should always prefix the table name to avoid problems with this. Observe that alias fields are not mapped of course (should not be a problem though)

Parameters:
array Input array, associative keys
array Array of tables from the query. Normally just one table; many tables in case of a join. NOTICE: for multiple tables (with joins) there MIGHT occur trouble with fields of the same name in the two tables: This function traverses the mapping information for BOTH tables and applies mapping without checking from which table the field really came!
boolean If true, reverse direction. Default direction is to map an array going INTO the database (thus mapping TYPO3 fieldnames to PHYSICAL field names!)
Returns:
array Output array, with mapped associative keys.

Definition at line 2259 of file class.ux_t3lib_db.php.

References $value.

Referenced by exec_INSERTquery(), exec_UPDATEquery(), and sql_fetch_assoc().

ux_t3lib_DB::map_fieldNamesInArray ( table,
&$  fieldArray 
)

Re-mapping field names in array

Parameters:
string (TYPO3) Table name for fields.
array Array of fieldnames to remap. Notice: Passed by reference!
Returns:
void

Definition at line 2461 of file class.ux_t3lib_db.php.

Referenced by map_genericQueryParsed().

ux_t3lib_DB::map_genericQueryParsed ( &$  parsedQuery  ) 

Will do table/field mapping on a general t3lib_sqlengine-compliant SQL query (May still not support all query types...)

Parameters:
array Parsed QUERY as from t3lib_sqlengine::parseSQL(). NOTICE: Passed by reference!
Returns:
void
See also:
t3lib_sqlengine::parseSQL()

... and here support for all other query types should be!

Definition at line 2396 of file class.ux_t3lib_db.php.

References map_fieldNamesInArray(), and map_needMapping().

Referenced by admin_query().

ux_t3lib_DB::map_needMapping ( tableList,
fieldMappingOnly = FALSE 
)

Checks if mapping is needed for a table(list)

Parameters:
string List of tables in query
boolean If true, it will check only if FIELDs are configured and ignore the mapped table name if any.
Returns:
mixed Returns an array of table names (parsed version of input table) if mapping is needed, otherwise just false.

Definition at line 2223 of file class.ux_t3lib_db.php.

References $key.

Referenced by admin_get_fields(), admin_get_keys(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), map_genericQueryParsed(), and sql_fetch_assoc().

ux_t3lib_DB::map_remapSELECTQueryParts ( &$  select_fields,
&$  from_table,
&$  where_clause,
&$  groupBy,
&$  orderBy 
)

Remaps table/field names in a SELECT query's parts Notice: All arguments are passed by reference!

Parameters:
string List of fields to select from the table. This is what comes right after "SELECT ...". Required value.
string Table(s) from which to select. This is what comes right after "FROM ...". Require value.
string Where clause. This is what comes right after "WHERE ...". Can be blank.
string Group by field(s)
string Order by field(s)
Returns:
void
See also:
exec_SELECTquery()

Definition at line 2308 of file class.ux_t3lib_db.php.

References map_sqlParts().

Referenced by exec_SELECTquery().

ux_t3lib_DB::map_sqlParts ( &$  sqlPartArray,
defaultTable 
)

Generic mapping of table/field names arrays (as parsed by t3lib_sqlengine)

Parameters:
array Array with parsed SQL parts; Takes both fields, tables, where-parts, group and order-by. Passed by reference.
string Default table name to assume if no table is found in $sqlPartArray
Returns:
void private
See also:
map_remapSELECTQueryParts()

Definition at line 2350 of file class.ux_t3lib_db.php.

Referenced by exec_DELETEquery(), exec_UPDATEquery(), and map_remapSELECTQueryParts().

ux_t3lib_DB::mapCachedFieldInfo ( fieldInfo  ) 

This function builds all definitions for mapped tables and fields

See also:
cacheFieldInfo()

Definition at line 300 of file class.ux_t3lib_db.php.

References $TYPO3_CONF_VARS.

Referenced by cacheFieldInfo().

ux_t3lib_DB::MetaType ( type,
table,
max_length = -1 
)

Return MetaType for native field type (ADOdb only!)

Parameters:
string native type as reported by admin_get_fields()
string Table name for which query type string. Important for detection of DBMS handler of the query!
Returns:
string Meta type (currenly ADOdb syntax only, http://phplens.com/lens/adodb/docs-adodb.htm#metatype)

Definition at line 1141 of file class.ux_t3lib_db.php.

References handler_getFromTableList(), and quoteFromTables().

Referenced by admin_get_fields().

ux_t3lib_DB::MySQLActualType ( meta  ) 

Return actual MySQL type for meta field type

Parameters:
string Meta type (currenly ADOdb syntax only, http://phplens.com/lens/adodb/docs-adodb.htm#metatype)
Returns:
string native type as reported as in mysqldump files, uppercase

Definition at line 1216 of file class.ux_t3lib_db.php.

Referenced by admin_get_fields().

ux_t3lib_DB::MySQLMetaType ( t  ) 

Return MetaType for native MySQL field type

Parameters:
string native type as reported as in mysqldump files
Returns:
string Meta type (currenly ADOdb syntax only, http://phplens.com/lens/adodb/docs-adodb.htm#metatype)

Definition at line 1169 of file class.ux_t3lib_db.php.

Referenced by analyzeFields().

ux_t3lib_DB::quoteFieldNames ( select_fields  ) 

Quotes field (and table) names with the quote character suitable for the DB being used

Parameters:
string List of fields to be used in query to DB
Returns:
string Quoted list of fields to be in query to DB

Definition at line 942 of file class.ux_t3lib_db.php.

References runningNative().

Referenced by _quoteWhereClause(), INSERTquery(), quoteSelectFields(), SELECTquery(), and UPDATEquery().

ux_t3lib_DB::quoteFromTables ( from_table  ) 

Quotes table names with the quote character suitable for the DB being used

Parameters:
string List of tables to be selected from DB
Returns:
string Quoted list of tables to be selected from DB

Definition at line 972 of file class.ux_t3lib_db.php.

References runningNative().

Referenced by DELETEquery(), exec_INSERTquery(), exec_UPDATEquery(), MetaType(), and SELECTquery().

ux_t3lib_DB::quoteGroupBy ( groupBy  ) 

[Describe function...]

Parameters:
[type] $$groupBy: ...
Returns:
[type] ...

Definition at line 1050 of file class.ux_t3lib_db.php.

References runningNative().

Referenced by SELECTquery().

ux_t3lib_DB::quoteOrderBy ( orderBy  ) 

[Describe function...]

Parameters:
[type] $$orderBy: ...
Returns:
[type] ...

Definition at line 1070 of file class.ux_t3lib_db.php.

References runningNative().

Referenced by SELECTquery().

ux_t3lib_DB::quoteSelectFields ( select_fields  ) 

Quotes field (and table) names with the quote character suitable for the DB being used Use quoteFieldNames instead!

Parameters:
string List of fields to be selected from DB
Returns:
string Quoted list of fields to be selected from DB
Deprecated:
since TYPO3 4.0

Definition at line 932 of file class.ux_t3lib_db.php.

References quoteFieldNames().

ux_t3lib_DB::quoteStr ( str,
table 
)

Substitution for PHP function "addslashes()" NOTICE: You must wrap the output of this function in SINGLE QUOTES to be DBAL compatible. Unless you have to apply the single quotes yourself you should rather use ->fullQuoteStr()!

Parameters:
string Input string
string Table name for which to quote string. Just enter the table that the field-value is selected from (and any DBAL will look up which handler to use and then how to quote the string!).
Returns:
string Output string; Quotes (" / ') and \ will be backslashed (or otherwise based on DBAL handler)
See also:
quoteStr()

Reimplemented from t3lib_DB.

Definition at line 1113 of file class.ux_t3lib_db.php.

References handler_getFromTableList().

ux_t3lib_DB::quoteWhereClause ( where_clause  ) 

Quotes the field (and table) names within a where clause with the quote character suitable for the DB being used

Parameters:
string A where clause that can e parsed by parseWhereClause
Returns:
string Usable where clause with quoted field/table names

Definition at line 999 of file class.ux_t3lib_db.php.

References _quoteWhereClause(), and runningNative().

Referenced by DELETEquery(), exec_INSERTquery(), exec_UPDATEquery(), and SELECTquery().

ux_t3lib_DB::runningADOdbDriver ( driver  ) 

Checks whether the ADOdb handler is running with a driver that contains the argument

Parameters:
string $driver Driver name, matched with strstr().
Returns:
boolean True if running with the given driver

Definition at line 2197 of file class.ux_t3lib_db.php.

Referenced by sql_fetch_assoc(), and sql_fetch_row().

ux_t3lib_DB::runningNative (  ) 

Checks whether the DBAL is currently inside an operation running on the "native" DB handler (i.e. MySQL)

Returns:
boolean True if running on "native" DB handler (i.e. MySQL)

Definition at line 2186 of file class.ux_t3lib_db.php.

Referenced by INSERTquery(), quoteFieldNames(), quoteFromTables(), quoteGroupBy(), quoteOrderBy(), quoteWhereClause(), and UPDATEquery().

ux_t3lib_DB::SELECTquery ( select_fields,
from_table,
where_clause,
groupBy = '',
orderBy = '',
limit = '' 
)

Creates a SELECT SQL-statement Usage count/core: 11

Parameters:
string See exec_SELECTquery()
string See exec_SELECTquery()
string See exec_SELECTquery()
string See exec_SELECTquery()
string See exec_SELECTquery()
string See exec_SELECTquery()
Returns:
string Full SQL query for SELECT

Reimplemented from t3lib_DB.

Definition at line 901 of file class.ux_t3lib_db.php.

References debugOutput, quoteFieldNames(), quoteFromTables(), quoteGroupBy(), quoteOrderBy(), and quoteWhereClause().

Referenced by exec_SELECTquery().

ux_t3lib_DB::sql ( db,
query 
)

Executes query (on DEFAULT handler!) DEPRECATED - use exec_* functions from this class instead!

Parameters:
string Database name
string Query to execute
Returns:
pointer Result pointer
Deprecated:
since TYPO3 4.1

Reimplemented from t3lib_DB.

Definition at line 1579 of file class.ux_t3lib_db.php.

References sql_query().

ux_t3lib_DB::sql_affected_rows (  ) 

Returns the number of rows affected by the last INSERT, UPDATE or DELETE query

Returns:
integer Number of rows affected by last query

Reimplemented from t3lib_DB.

Definition at line 1463 of file class.ux_t3lib_db.php.

ux_t3lib_DB::sql_data_seek ( &$  res,
seek 
)

Move internal result pointer

Parameters:
pointer MySQL result pointer (of SELECT query) / DBAL object
integer Seek result number.
Returns:
boolean Returns TRUE on success or FALSE on failure.

Definition at line 1486 of file class.ux_t3lib_db.php.

References $res.

ux_t3lib_DB::sql_errno (  ) 

Returns the error number on the most recent sql() execution (based on $this->lastHandlerKey)

Returns:
int Handler error number

Reimplemented from t3lib_DB.

Definition at line 1280 of file class.ux_t3lib_db.php.

ux_t3lib_DB::sql_error (  ) 

Returns the error status on the most recent sql() execution (based on $this->lastHandlerKey)

Returns:
string Handler error strings

Reimplemented from t3lib_DB.

Definition at line 1259 of file class.ux_t3lib_db.php.

Referenced by admin_get_tables(), debugHandler(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), and sql_query().

ux_t3lib_DB::sql_fetch_assoc ( &$  res  ) 

Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows.

Parameters:
pointer MySQL result pointer (of SELECT query) / DBAL object
Returns:
array Associative array of result row.

Definition at line 1326 of file class.ux_t3lib_db.php.

References $key, $res, $value, map_assocArray(), map_needMapping(), and runningADOdbDriver().

Referenced by admin_get_tables(), and debug_explain().

ux_t3lib_DB::sql_fetch_row ( &$  res  ) 

Returns an array that corresponds to the fetched row, or FALSE if there are no more rows. The array contains the values in numerical indices.

Parameters:
pointer MySQL result pointer (of SELECT query) / DBAL object
Returns:
array Array with result rows.

Definition at line 1377 of file class.ux_t3lib_db.php.

References $key,