Automatisk nummer
Hej Gutter og Gutinder :-)Jeg sidder lige fast i et lille stillings script jeg er igang med at lave, jeg skulle gerne bare have sat 1-2-3 osv i placeringer på alt efter hvor mange rækker jeg får. min kode er her..
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td width="18%"><strong>Placering</strong></td>
<td width="22%"><div align="left"><strong>Hold</strong></div></td>
<td width="21%"><div align="center"><strong>Kampe</strong></div></td>
<td width="11%"><div align="center"><strong>Vundne</strong></div></td>
<td width="16%"><div align="center"><strong>Uafgjorte</strong></div></td>
<td width="6%"><div align="center"><strong>Tabte</strong></div></td>
<td width="6%"><div align="center"><strong>Score</strong></div></td>
<td width="6%"><div align="center"><strong>Point</strong></div></td>
</tr>
<?php
$hent = @mysql_query("SELECT * FROM stilling order by point ASC");
if (mysql_num_rows($hent) == "0"){
echo "No matches...";
} else {
while ($vis = @mysql_fetch_array($hent)) {
$id = $vis['id'];
$hold = $vis['hold'];
$kampe = $vis['kampe'];
$background = ($foo++ % 2) ? '#FFFFFF' : '#EDEDED';
$vundne = $vis['vundne'];
$uafgjort = $vis['uafgjort'];
$score = $vis['score'];
$tabte = $vis['tabte'];
$point = $vis['point'];
?>
<tr bgcolor="<?php echo $background; ?>">
<td><span class="graover"><?php echo $date; ?></span></td>
<td><div align="left"><span class="graover"><?php echo $hold; ?></span></div></td>
<td><div align="center"><span class="graover"><?php echo $kampe; ?></span></div></td>
<td><div align="center"><span class="graover"><?php echo $vundne; ?></span></div></td>
<td><div align="center"><span class="graover"><?php echo $uafgjort; ?></span></div></td>
<td><div align="center"><span class="graover"><?php echo $tabte; ?></span></div></td>
<td><div align="center"><span class="graover"><?php echo $score; ?></span></div></td>
<td><div align="center"><span class="graover"><?php echo $point; ?></span></div></td>
</tr>
<?php
}
}
?>
</table>