Okay, so I followed the advice on this question: http://stackoverflow.com/questions/1214176/stumped-in-the-middle-of-a-php-loop
But now, I'm having even more problems than before. Here's what I have so far:
$sql = "SELECT section_name, category_name, result_level, url, winner FROM 2009_RKR_bestof INNER JOIN categories ON 2009_RKR_bestof.category = categories.category_id INNER JOIN sections ON 2009_RKR_bestof.section = sections.section_id ORDER BY section_name,category_name ASC";
$query = mysql_query($sql);
$current_section = "";
while ($stuff = mysql_fetch_array($query)) {
if ($current_section == "") {
$current_section = $stuff["section_name"];
echo "<h3>$current_section</h3>";
echo "<h4>$stuff[category_name]</h4>";
}
if ($current_section == $stuff["section_name"]) {
//what the heck do i do here?
} elseif ($current_section != $stuff["section_name"]) {
$current_section = $stuff["section_name"];
echo "<h3>$current_section</h3>";
}
}
And my output is here: http://www.theroanoker.com/bestof/index1.php
By my old code, I had gotten this far: http://www.theroanoker.com/bestof/index2.php
I'm beating my head against the wall. Can someone guide me a bit more?