Created
March 17, 2015 12:28
-
-
Save Skyl0/4ed5d8173365a486d36b to your computer and use it in GitHub Desktop.
Problems with JOIN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = $GLOBALS["TYPO3_DB"]->exec_SELECTquery( | |
'tx_y7fahrzeugdatenbank_domain_model_fahrzeug.uid, tx_y7fahrzeugdatenbank_domain_model_fahrzeug.name, tx_y7fahrzeugdatenbank_domain_model_fahrzeug.beschreibung, news_uid, fahrzeug_uid', // SELECT | |
'tx_y7fahrzeugdatenbank_domain_model_fznewsrel JOIN tx_y7fahrzeugdatenbank_domain_model_fahrzeug ON tx_y7fahrzeugdatenbank_domain_model_fznewsrel.fahrzeug_uid = tx_y7fahrzeugdatenbank_domain_model_fahrzeug.uid', // FROM | |
'news_uid = 7' /*. $row['uid']*/, //WHERE | |
'', //GROUPBY | |
'', //ORDERBY | |
'', //LIMIT | |
'' //uidIndexField | |
); | |
$res = $GLOBALS['TYPO3_DB']->sql_fetch_assoc( $query ); | |
//debug | |
debug($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery, '('.__CLASS__.'::'.__FUNCTION__.')', __LINE__, __FILE__, 3); | |
debug($res, '('.__CLASS__.'::'.__FUNCTION__.')', __LINE__, __FILE__, 3); // TODO DELETE | |
// $this->cObj = $tt_news->local_cObj; | |
$editObj .= '<tr><th>Name</th><th>Beschreibung</th></tr>'; | |
$counter = 0; | |
foreach ($res as $obj) { | |
debug($obj, '('.__CLASS__.'::'.__FUNCTION__.')', __LINE__, __FILE__, 3); // TODO DELETE | |
$counter++; | |
$editObj .= '<tr><td class="tx_y7fz_td_' . $counter . '_1">' . $obj['name'] . '</td><td class="tx_y7fz_td_' . $counter . '_2">' . $obj['beschreibung'] . '</td></tr>'; | |
} |
Author
Skyl0
commented
Mar 17, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment