Tamam, ben bu soruya tavsiye izledi: http://stackoverflow.com/questions/1214176/stumped-in-the-middle-of-a-php-loop
Ama şimdi, ben daha önce daha fazla sorun yaşıyorum. İşte ben bugüne kadar ne var:
$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
Ben kafamı duvara yeniyorum. Birisi biraz daha bana rehberlik eder?