Mailinglisten-Archive |
ein MySQL result wird ausgegeben und alle 4 zeilen soll die table reihe geschlossen bzw geöffnet werden. <table width="100%" border="1"> <?php $result = mysql_query("SELECT id FROM table"); $mysql_num_rows = mysql_num_rows($result); $td_num = 4; $tr_num_rows = ($mysql_num_rows / $td_num); echo "Ergebnisse: $mysql_num_rows<br>"; echo "Zellen pro Reihe: $td_num<br>"; echo "Benötigete Reihen: $tr_num_rows"; for($tr = 0; $tr <$tr_num_rows; $tr++) { echo " <tr>\n"; for($td = 0; $td < $td_num; $td++) { $td_row = $tr * $td_num + $td; $value = mysql_result($result, $td_row, "id"); echo "<td>$value </td>"; } echo " </tr>\n"; } ?> </table>
php::bar PHP Wiki - Listenarchive