[TYPO3-german] Re: mysql_num_fields - Ersatz

Stefan Stuck stefan.stuck at tangram.de
Wed Jan 21 13:10:57 CET 2015


ok, habe es nun so gelöst:

	$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
//Felder der DB-Tabelle auslesen
	$tablefields = $GLOBALS['TYPO3_DB']->sql_query("SHOW COLUMNS FROM ".$anlage);
	$numfds = $GLOBALS['TYPO3_DB']->sql_num_rows($tablefields);
	$feldname = array();
	$fieldcount=0;
	while ($field=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($tablefields)){
		$feldname[$fieldcount] = $field['Field'];
		$fieldcount++;
	}
	$GLOBALS['TYPO3_DB']->sql_free_result($tablefields);
      ...
      while ($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)){
      ....
            for($f=0; $f<$numfds; $f++) {
		$feld =$feldname[$f];
		$liste.= "<div class='detail'><div class='feld'>".$feld.":</div><div class='wert'>". $row[$feld]."</div></div>";
      ....
            }
      }


More information about the TYPO3-german mailing list