In the code below, Im outputting rows and ordering them by points. Ive tried setting ASC and DESC. They change how the rows are ordered but still they arent in chronological order so to speak.
The output Im getting is
Row 1 - 100 points
Row 2 - 25 points
Row 3 - 44 points
Row 4 - 77 points
This is the code I am using that gave me the above results. Any Ideas?
$place = 1;
$result4 = mysql_query("SELECT * FROM " . $prefix . "_tourn_results WHERE sched_id='$sched_id' ORDER BY results_points");
while($row4 = mysql_fetch_array($result4)){
if($bgcolor == "#ffffff"){
$bgcolor = "#e6e6e6";
}else{
$bgcolor = "#ffffff";
}
$result5 = mysql_query("SELECT * FROM " . $user_prefix . "_tourn_teams WHERE team_id='$row4[team_id]'");
while($row5 = mysql_fetch_array($result5)){
$result6 = mysql_query("SELECT * FROM " . $user_prefix . "_tourn_schedules WHERE sched_id='$row4[sched_id]'");
while($row6 = mysql_fetch_array($result6)){
echo "<tr bgcolor=".$bgcolor.">";
echo "<td align=\"center\"><font>$place</font></td>";
echo "<td align=\"left\"><font>$row5[partner1_firstname] $row5[partner1_lastname] / $row5[partner2_firstname] $row5[partner2_lastname]</font></td>";
echo "<td align=\"center\"><font>$row4[results_numfish]</font></td>";
echo "<td align=\"center\"><font>$row4[results_livefish]</font></td>";
echo "<td align=\"center\"><font>$row4[results_wgt]</font></td>";
echo "<td align=\"center\"><font>$row4[results_bigfish]</font></td>";
echo "<td align=\"center\"><font>$row4[results_penalty]</font></td>";
echo "<td align=\"center\"><font>$row4[results_netwgt]</font></td>";
echo "<td align=\"right\"><font>$row4[results_points]</font>";
echo "</td></tr>";
$place++;
}
}
}