My apologies if this has been answered before; I haven't found it.
I'm working on making a gig schedule for my site, where I can just add everything into mysql and have it show up. That part I have taken care of, and it works just fine. Here's what I'm stumped at.
I would like the php to move any of the performances that have already happened to a spot below the "Upcoming Performances" section, entitled "Previous Performances." This is the code thus far.
$sql = mysql_query ("SELECT * FROM `Schedule` ORDER BY day ASC") or die (mysql_error ());
echo "<table width=100%>" . "<br>" .
"<tr><td width=15%>Date</td>" .
"<td width=10%>Time</td>" .
"<td width=20%>Venue</td>" .
"<td width=20%>Performance</td>" .
"<td width=10%>Price</td>" .
"<td width=25%>Additional Information</td></tr>";
while ($row = mysql_fetch_assoc ($sql)) {
echo "<tr><td>" . date("D, F j", strtotime($row['day'])) . "</td>" .
"<td>" . $row['time'] . "</td>" .
"<td>" . $row['venue'] . "</td>" .
"<td>" . $row['show'] . "</td>" .
"<td>" . $row['price'] . "</td>" .
"<td>" . $row['info'] . "</td></tr>";
}
echo "</table>";
My thought is that I need to add in the line for the mysql_query something to the effect of WHERE day >= "current date" for the first one, and then repeat this code below it, with a WHERE day < "current date" function. Am I on the right path? Any comments are appreciated.