[TYPO3-german] Alle Einträge aus DB Tabelle holen

Andreas Regneri regneri at 10eg.com
Fri Mar 2 16:13:35 CET 2007


Hallo!

Du musst das Ergebnis "$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)" durch
eine Schleife laufen lassen, um alle Datensätze zu erhalten!

Also z.B. so:

$zaehler = 0;
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
 ...
 $row[$zaehler][Spalte-der-Tabelle] = $row[Spalte-der-Tabelle];
 $zaehler++;
 ...
}

Gruß
Andreas


> -----Ursprüngliche Nachricht-----
> Von: typo3-german-bounces at lists.netfielders.de 
> [mailto:typo3-german-bounces at lists.netfielders.de] Im Auftrag 
> von Genc, Ural
> Gesendet: Freitag, 2. März 2007 15:42
> An: typo3-german at lists.netfielders.de
> Betreff: [TYPO3-german] Alle Einträge aus DB Tabelle holen
> 
> Hallo Leute,
> 
> programmier grad an einer eigenen Extension herum, dafür muss 
> ich alle Einträge die in meiner Tabelle 'tx_bmrepres_repres' 
> sind in ein Array speichern.
> 
> Habs so probiert:
> 
> [PHP]
> ...
> $fields = '*';
> $from = 'tx_bmrepres_repres';
> $where = 'pid = '.$this->cObj->data['pages'];.' AND deleted = 
> 0 AND hidden = 0'; $res = 
> $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$from,$where);
> $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
> ...
> [/PHP]
> 
> Dieser code gibt mir immer nur den ersten Datensatz aus. Ich 
> bräuchte es aber so:
> 
> $row = array();
> $row[0]['name']
> $row[0]['vorname']
> 
> $row[1]['name']
> $row[1]['vorname']
> 
> Hoffe jemand kann mir helfen.
> 
> 
> LG aus dem Schwarzwald
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german
> 
> 
> __________ NOD32 2089 (20070302) Information __________
> 
> Diese E-Mail wurde vom NOD32 antivirus system geprüft 
> http://www.nod32.com
> 
> 



More information about the TYPO3-german mailing list