Forum Moderators: coopster
I have written a basic script that shows the latest gigs for a band, what i am after is that once the date has been and gone, the gig details change colour so users can see the old and the new straight of.
Below is what i have so far...
// Create a Query
$query ="SELECT DATE_FORMAT(Date, '%d.%m.%Y at %H:%i'), Subject, Venue FROM DB_Table_Name ORDER BY Date DESC";
// Execute the Query
$result = mysql_query($query) or die ("Error in Query: $query. ".mysql_error());
// See if any rows were returned
if (mysql_num_rows($result) > 0) {
// If the statement is YES then Print them 1 after another
while(list($Date, $Subject, $Venue) = mysql_fetch_row($result)) {
echo "<b>$Date:<br />What?</b> $Subject<br />";
echo "<b>Where?</b> $Venue<br />";
echo "<hr />";
Any help would be appreciated.
Thanks
// Create a Query
$query ="SELECT DATE_FORMAT(Date, '%d.%m.%Y at %H:%i'),(Date<now()) AS Old_Gig, Subject, Venue FROM DB_Table_Name ORDER BY Date DESC";
// Execute the Query
$result = mysql_query($query) or die ("Error in Query: $query. ".mysql_error());
// See if any rows were returned
if (mysql_num_rows($result) > 0) {
// If the statement is YES then Print them 1 after another
while(list($Date, $Old_Gig, $Subject, $Venue) = mysql_fetch_row($result)) {
if ($Old_Gig == 1) echo '<span style="color:gray">';
echo "<b>$Date:<br />What?</b> $Subject<br />";
echo "<b>Where?</b> $Venue<br />";
if ($Old_Gig == 1) echo '</span>';
echo "<hr />";
[edited by: jezzer300 at 11:09 am (utc) on Nov. 15, 2005]