Weiss jemand ob und warum die "update ghostwm set WM_Punkte=$wm where ID=$daten[ID];" Zeile nicht funktioniert? Geht es innerhalb dieses arrays überhaupt?
<?php
$result=mysql_query("SELECT ID,Platz,Zeit,Fahrername,WM_Punkte,Ghost_Punkte,Steuerung,Ghostfile FROM ghostwm WHERE Jahr='2002' and Strecke='Australien' ORDER BY Zeit");
$i=1;
print
('<table border="1" align="center" width="300" cellspacing="1" style="border-style: ridge; font-family:Times New Roman; font-size:11pt; font-weight:bold">');
while ($daten=mysql_fetch_array($result))
{
if ( $i == 1 ){ $wm = 10 ; $ghost = 15;}
elseif ( $i == 2 ){ $wm = 6 ; $ghost = 14;}
elseif ( $i == 3 ){ $wm = 4 ; $ghost = 13;}
elseif ( $i == 4 ){ $wm = 3 ; $ghost = 12;}
elseif ( $i == 5 ){ $wm = 2 ; $ghost = 11;}
elseif ( $i == 6 ){ $wm = 1 ; $ghost = 10;}
elseif ( $i == 7 ){ $wm = 0 ; $ghost = 9;}
elseif ( $i == 8 ){ $wm = 0 ; $ghost = 8;}
elseif ( $i == 9 ){ $wm = 0 ; $ghost = 7;}
elseif ( $i == 10 ){ $wm = 0 ; $ghost = 6;}
elseif ( $i == 11 ){ $wm = 0 ; $ghost = 5;}
elseif ( $i == 12 ){ $wm = 0 ; $ghost = 4;}
elseif ( $i == 13 ){ $wm = 0 ; $ghost = 3;}
elseif ( $i == 14 ){ $wm = 0 ; $ghost = 2;}
elseif ( $i == 15 ){ $wm = 0 ; $ghost = 1;}
else{ $wm = 0; $ghot = 0;}
update ghostwm set WM_Punkte=$wm where ID=$daten[ID];
print("
<tr>
<td align='center' bgcolor='#FFCC00'>$i.</td>
<td align='left' bgcolor='#FFCC00'>$daten[ID]</td>
<td align='left' bgcolor='#FFCC00'>$daten[Zeit]</td>
<td align='center' bgcolor='#FFCC00'>$daten[Fahrername]</td>
<td align='center' bgcolor='#FFCC00'>$wm</td>
<td align='center' bgcolor='#FFCC00'>$ghost</td>
<td align='left' bgcolor='#FFCC00'>$daten[Steuerung]</td>
<td align='center' bgcolor='#FFCC00'>$daten[Ghostfile]</td>
</tr>
");
$i++;
}
print ('</table>');
?>
<?php
$result=mysql_query("SELECT ID,Platz,Zeit,Fahrername,WM_Punkte,Ghost_Punkte,Steuerung,Ghostfile FROM ghostwm WHERE Jahr='2002' and Strecke='Australien' ORDER BY Zeit");
$i=1;
('<table border="1" align="center" width="300" cellspacing="1" style="border-style: ridge; font-family:Times New Roman; font-size:11pt; font-weight:bold">');
while ($daten=mysql_fetch_array($result))
{
if ( $i == 1 ){ $wm = 10 ; $ghost = 15;}
elseif ( $i == 2 ){ $wm = 6 ; $ghost = 14;}
elseif ( $i == 3 ){ $wm = 4 ; $ghost = 13;}
elseif ( $i == 4 ){ $wm = 3 ; $ghost = 12;}
elseif ( $i == 5 ){ $wm = 2 ; $ghost = 11;}
elseif ( $i == 6 ){ $wm = 1 ; $ghost = 10;}
elseif ( $i == 7 ){ $wm = 0 ; $ghost = 9;}
elseif ( $i == 8 ){ $wm = 0 ; $ghost = 8;}
elseif ( $i == 9 ){ $wm = 0 ; $ghost = 7;}
elseif ( $i == 10 ){ $wm = 0 ; $ghost = 6;}
elseif ( $i == 11 ){ $wm = 0 ; $ghost = 5;}
elseif ( $i == 12 ){ $wm = 0 ; $ghost = 4;}
elseif ( $i == 13 ){ $wm = 0 ; $ghost = 3;}
elseif ( $i == 14 ){ $wm = 0 ; $ghost = 2;}
elseif ( $i == 15 ){ $wm = 0 ; $ghost = 1;}
else{ $wm = 0; $ghot = 0;}
update ghostwm set WM_Punkte=$wm where ID=$daten[ID];
print("
<tr>
<td align='center' bgcolor='#FFCC00'>$i.</td>
<td align='left' bgcolor='#FFCC00'>$daten[ID]</td>
<td align='left' bgcolor='#FFCC00'>$daten[Zeit]</td>
<td align='center' bgcolor='#FFCC00'>$daten[Fahrername]</td>
<td align='center' bgcolor='#FFCC00'>$wm</td>
<td align='center' bgcolor='#FFCC00'>$ghost</td>
<td align='left' bgcolor='#FFCC00'>$daten[Steuerung]</td>
<td align='center' bgcolor='#FFCC00'>$daten[Ghostfile]</td>
</tr>
");
$i++;
}
print ('</table>');
?>
Kommentar