オーケーと困惑したので、私はこの質問へのアドバイスに続く:Stumped in the middle of a PHP loop- PHPループ
をしかし、今、私は以前よりもさらに多くの問題を抱えています。ここで私がこれまで持っているものです。
$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>";
}
}
そして、私の出力はここにある:私の古いコードによってhttp://www.theroanoker.com/bestof/index1.php
、私はここまで得ていた:http://www.theroanoker.com/bestof/index2.php
私は壁に頭を叩いています。誰かがもう少し私を導くことができますか?
多分あなたはより良い(対話的な)ヘルプを得ることができるフォーラムにあなたの質問をする必要がありますか? SOの形式は、一方向のQ&Aをもっと目的としています。私はSitepoint for PHPに関連する質問を推奨することができます:http://www.sitepoint.com/forums/forumdisplay.php?f=34 – troelskn
'$ stuff'に対して' var_dump'を実行して、私があなたが何をしているのかを見ることができますか?と? –
あなたは何をしようとしているのか説明できますか? – Dirk