Regning i PHP: Flere tabellers data samlet i en formel
Jeg har brug for at lave statistik af Results fra felterne Won og Lost..PASTE:
echo \"<table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" class=\\\"td1\\\" bgcolor=\\\"#243130\\\"><tr><td><table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"1\\\">\";
echo \"<tr class=\\\"td3\\\" bgcolor=\\\"#87A5A2\\\"><td colspan=\\\"5\\\" height=\\\"2\\\"> <b><font size=\\\"2\\\" face=\\\"Verdana, Arial, Helvetica, sans-serif\\\">TwisH Division: 1st</font></b></td></tr>\";
include \"include/war_head.html\";
while ($myrow = mysql_fetch_row($result)) {
if ($myrow[2] < $myrow[3]) {
$col = \"FF0000\";
} else {
$col = \"0000FF\";
}
if ($myrow[6] == NULL) {
$opponent = $myrow[5];
} else {
$opponent = $myrow[6];
}
if ($myrow[7] == NULL) {
$rules = \"unknown\";
} else {
$rules = $myrow[7];
}
echo \"<tr><td align=\\\"center\\\" class=\\\"td2\\\" height=\\\"15\\\"><font face=\\\"Verdana, Arial, Helvetica, sans-serif\\\" color=\\\"#000000\\\" size=\\\"1\\\"> $opponent </td>\";
echo \"<td align=\\\"center\\\" class=\\\"td2\\\" height=\\\"15\\\"><font face=\\\"Verdana, Arial, Helvetica, sans-serif\\\" color=\\\"#000000\\\" size=\\\"1\\\"> $rules </td>\";
echo \"<td align=\\\"center\\\" class=\\\"td2\\\" height=\\\"15\\\"><font face=\\\"Verdana, Arial, Helvetica, sans-serif\\\" color=\\\"$col\\\" size=\\\"1\\\"> $myrow[2]/$myrow[3] </td>\";
echo \"<td align=\\\"center\\\" class=\\\"td2\\\" height=\\\"15\\\"><font face=\\\"Verdana, Arial, Helvetica, sans-serif\\\" color=\\\"#000000\\\" size=\\\"1\\\"> $myrow[4] </td>\";
echo \"<td align=\\\"center\\\" class=\\\"td2\\\" height=\\\"15\\\"><font face=\\\"Verdana, Arial, Helvetica, sans-serif\\\" color=\\\"#000000\\\" size=\\\"1\\\"><a href=\\\".?view=clanwars&id=$myrow[0]\\\">Match Report</a></td></tr>\";
}
echo \"</tr></td></table></tr></td></table><br>\";
Hvodden kan jeg gøre det ?