Project

General

Profile

Bug #15089 » 1649-1.patch

Administrator Admin, 2005-12-22 19:28

View differences:

class.t3lib_db.php 22 Dec 2005 18:24:57 -0000
* @see exec_SELECTquery()
*/
function exec_SELECT_mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='') {
if($foreign_table == $local_table) {
$foreign_table_as = $foreign_table.uniqid('_join');
}
$mmWhere = $local_table ? $local_table.'.uid='.$mm_table.'.uid_local' : '';
$mmWhere.= ($local_table AND $foreign_table) ? ' AND ' : '';
$mmWhere.= $foreign_table ? $foreign_table.'.uid='.$mm_table.'.uid_foreign' : '';
$mmWhere.= $foreign_table ? ($foreign_table_as ? $foreign_table_as : $foreign_table).'.uid='.$mm_table.'.uid_foreign' : '';
return $GLOBALS['TYPO3_DB']->exec_SELECTquery(
$select,
($local_table ? $local_table.',' : '').$mm_table.($foreign_table ? ','.$foreign_table : ''),
($local_table ? $local_table.',' : '').$mm_table.($foreign_table ? ','.($foreign_table_as ? $foreign_table_as : $foreign_table) : ''),
$mmWhere.' '.$whereClause, // whereClauseMightContainGroupOrderBy
$groupBy,
$orderBy,
(2-2/2)