Hallo Leute,
ich bin jetzt schon ewig dran mein Problem zu lösen, aber ich finde einfach keine Lösung dazu.
Ich habe mir eine Datenbank aufgebaut in die ich einzelne Ergebnisse von Matches eingebe.
Ich habe es soweit geschafft, dass ich eine Tabelle angezeigt bekomme aber jetzt weis ich es nicht, wie ich es anstellen soll, dass er mir die Tabelle sortiert und korrekt sortiert nach Punkten bei Punktgleichheit nach Ringen zu sortieren.
Mein Code sieht zur Zeit so aus:
PHP
<?php
include("config.inc.php");
include("datenbank.inc.php");
$abfrage = "SELECT * from liveticker WHERE id='$_REQUEST[id]' LIMIT 1";
echo <<<ABC
<table border="0">
<tr>
<td></td>
</tr>
ABC;
$result = mysql_query($abfrage,$connect_id);
echo mysql_error();
while ($row = mysql_fetch_array ($result))
{
$id = $row['id'];
$m1 = $row['m1'];
$m2 = $row['m2'];
$m3 = $row['m3'];
$m4 = $row['m4'];
$m5 = $row['m5'];
$m6 = $row['m6'];
$m7 = $row['m7'];
$m8 = $row['m8'];
$jahr = $row['jahr'];
$liga = $row['liga'];
$datum = $row['datum'];
$ort= $row['ort'];
$text= $row['text'];
$anzeigen = $row['anzeigen'];
$ringe1 = $row['match3'] + $row['match7g1'] + $row['match10'] + $row['match16'] + $row['match20g1'] + $row['match21'] + $row['match25g1'];
$ringe2 = $row['match2'] + $row['match8g1'] + $row['match11'] + $row['match13g1'] + $row['match19g1'] + $row['match22g1'] + $row['match25'];
$ringe3 = $row['match4'] + $row['match5'] + $row['match12g1'] + $row['match14g1'] + $row['match19'] + $row['match21g1'] + $row['match27g1'];
$ringe4 = $row['match1g1'] + $row['match6g1'] + $row['match9'] + $row['match15g1'] + $row['match20'] + $row['match22'] + $row['match27'];
$ringe5 = $row['match1'] + $row['match5g1'] + $row['match11g1'] + $row['match16g1'] + $row['match18'] + $row['match24'] + $row['match26g1'];
$ringe6 = $row['match4g1'] + $row['match8'] + $row['match10g1'] + $row['match15'] + $row['match17g1'] + $row['match23g1'] + $row['match26'];
$ringe7 = $row['match2g1'] + $row['match7'] + $row['match9g1'] + $row['match14'] + $row['match17'] + $row['match24g1'] + $row['match28'];
$ringe8 = $row['match3g1'] + $row['match6'] + $row['match12'] + $row['match13'] + $row['match18g1'] + $row['match23'] + $row['match28g1'];
$punkteg1 = $row['p3'] + $row['p7g1'] + $row['p10'] + $row['p16'] + $row['p20g1'] + $row['p21'] + $row['p25g1'];
$punkteg2 = $row['p2'] + $row['p8g1'] + $row['p11'] + $row['p13g1'] + $row['p19g1'] + $row['p22g1'] + $row['p25'];
$punkteg3 = $row['p4'] + $row['p5'] + $row['p12g1'] + $row['p14g1'] + $row['p19'] + $row['p21g1'] + $row['p27g1'];
$punkteg4 = $row['p1g1'] + $row['p6g1'] + $row['p9'] + $row['p15g1'] + $row['p20'] + $row['p22'] + $row['p27'];
$punkteg5 = $row['p1'] + $row['p5g1'] + $row['p11g1'] + $row['p16g1'] + $row['p18'] + $row['p24'] + $row['p26g1'];
$punkteg6 = $row['p4g1'] + $row['p8'] + $row['p10g1'] + $row['p15'] + $row['p17g1'] + $row['p23g1'] + $row['p26'];
$punkteg7 = $row['p2g1'] + $row['p7'] + $row['p9g1'] + $row['p14'] + $row['p17'] + $row['p24g1'] + $row['p28'];
$punkteg8 = $row['p3g1'] + $row['p6'] + $row['p12'] + $row['p13'] + $row['p18g1'] + $row['p23'] + $row['p28g1'];
$punktev1 = $row['p3g1'] + $row['p7'] + $row['p10g1'] + $row['p16g1'] + $row['p20'] + $row['p21g1'] + $row['p25'];
$punktev2 = $row['p2g1'] + $row['p8'] + $row['p11g1'] + $row['p13'] + $row['p19'] + $row['p22'] + $row['p25g1'];
$punktev3 = $row['p4g1'] + $row['p5g1'] + $row['p12'] + $row['p14'] + $row['p19g1'] + $row['p21'] + $row['p27'];
$punktev4 = $row['p1'] + $row['p6'] + $row['p9g1'] + $row['p15'] + $row['p20g1'] + $row['p22g1'] + $row['p27g1'];
$punktev5 = $row['p1g1'] + $row['p5'] + $row['p11'] + $row['p16'] + $row['p18g1'] + $row['p24g1'] + $row['p26'];
$punktev6 = $row['p4'] + $row['p8g1'] + $row['p10'] + $row['p15g1'] + $row['p17'] + $row['p23'] + $row['p26g1'];
$punktev7 = $row['p2'] + $row['p7g1'] + $row['p9'] + $row['p14g1'] + $row['p17g1'] + $row['p24'] + $row['p28g1'];
$punktev8 = $row['p3'] + $row['p6g1'] + $row['p12g1'] + $row['p13g1'] + $row['p18'] + $row['p23g1'] + $row['p28'];
echo <<<ABC
<tr><td>$m1</td><td>$ringe1</td><td>$punkteg1</td><td>$punktev1</td></tr>
<tr><td>$m2</td><td>$ringe2</td><td>$punkteg2</td><td>$punktev2</td></tr>
<tr><td>$m3</td><td>$ringe3</td><td>$punkteg3</td><td>$punktev3</td></tr>
<tr><td>$m4</td><td>$ringe4</td><td>$punkteg4</td><td>$punktev4</td></tr>
<tr><td>$m5</td><td>$ringe5</td><td>$punkteg5</td><td>$punktev5</td></tr>
<tr><td>$m6</td><td>$ringe6</td><td>$punkteg6</td><td>$punktev6</td></tr>
<tr><td>$m7</td><td>$ringe7</td><td>$punkteg7</td><td>$punktev7</td></tr>
<tr><td>$m8</td><td>$ringe8</td><td>$punkteg8</td><td>$punktev8</td></tr>
ABC;
}
?>
</table>
<?
mysql_close($connect_id);
?>
Alles anzeigen
Wenn ihr mir da helfen würdet wäre ich euch unendlich dankbar.