I'm not exactly sure how to even ask the question, and I know my terminology
is not good as I'm a SQL beginner, but, here goes.
I need to find a way to make an if statement within an array...or, the
"while" portion of a recordset.
The best way I can ask is show what I mean.
http://oscarguy.mechphisto.net/awardbrowse.php
If you go there and select an award (like Best Picture), leave the year
field alone, and select YES and submit, you'll see a lot of results. And I
have HR's dividing each entry.
What I need to do is group all the entries of the same year, or at least
only put HR's between the blocks of years.
So, I'd have all the entries for 2002, an HR, then all for 2001, an HR, etc.
Here at the bottom I'll include my PHP code I'm using so far.
But I have no idea where to even start looking for an answer...if it's even
possible.
If someone can just give me the name of the function or process or
technique, then I can go Web/book searching myself...I just need a direction
of where to go.
Thanks for any help!!
Liam
PHP:------------------------------------------------------------------------
------
$query_RS_award = "SELECT * FROM $award WHERE id != '1' ORDER BY year DESC,
w DESC";
//$query_RS_award = "SELECT * FROM $award WHERE year =
\"$year\"";
$RS_award = @mysql_query($q uery_RS_award, $connection) or
die("Couldn't query: " . mysql_error());
$totalRows_RS1 = mysql_num_rows( $RS_award);
while ($row_RS_award = mysql_fetch_ass oc($RS_award)) {
$award_id = $row_RS_award['id'];
$award_tblid = $row_RS_award['tblid'];
$award_award = $row_RS_award['award'];
$award_year = $row_RS_award['year'];
$award_category = $row_RS_award['category'];
$award_won = $row_RS_award['w'];
$award_film = $row_RS_award['film'];
$award_nominee = $row_RS_award['nominee'];
$award_note = $row_RS_award['note'];
if (!($award_categ ory)) {
$award_category = "n/a";
} else {
$award_category = $award_category ;
}
if ($award_won == "1") {
$award_won = " - Award Winner";
} else {
$award_won = "";
}
$display_block_ Award .= "YEAR: <sp an
class='normalTe xt12White'>$awa rd_year</span><br>FILM:& nbsp;<span
class='normalTe xt12White'>$awa rd_film</span><br>CATEGO RY: <span
class='normalTe xt12White'>$awa rd_category</span><br>NOMINE E: <span
class='normalTe xt12White'>$awa rd_nominee</span><span
class='normalTe xt12BoldWhite'> $award_won</span><br><block quote><span
class='normalTe xt12White'>$awa rd_note</span></blockquote><hr> ";
}