You can collect data in a two-dimensional array and later use this array to create output in different formats:
$rows = array(); $index = 0; while ($row = mysql_fetch_assoc($result)) $rows[0][] = ++$index; $rows[1][] = $row['RID']; } $table = '<table class="table table-condensed table-bordered neutralize"> <tbody> <tr><td><b>Kriterium</b></td><td>%s</td></tr> <tr><td><b>Betyg</b></td><td>%s</td></tr> </tbody> </table>'; printf( $table, implode('</td><td>', $rows[0]), implode('</td><td>', $rows[1]) );
ioseb source share