Jump to content

WHERE $DATE >= Today


TimGreenwood

Recommended Posts

In the following code block, how do I limit the query to  WHERE $DATE >= Today's date?

(This is OLD code - and I'm neither very good at PHP nor SQL - so be kind.)

(I've looked up every reference I could find and spent hours getting it THIS far - and can't seem to make it over this last hurdle. PLEASE HELP.)

<?
if (!isset($offset)) $offset = 0;
$limit = 32; // this detemines max records per page

$users_query = "SELECT * FROM ItineraryTim ORDER BY date DESC";
$users_limit = " LIMIT " . $offset . "," . $limit;
//$users_limit = " where date>=GetDate() " . $limit;

$users_display = @mysql_query($users_query.$users_limit) or die ("ERROR: The query failed.");


while ($row = @mysql_fetch_array($users_display))
{
	$LINEID = $row["LineID"];
	$LOCATION = $row["Location"];
	$EVENT = $row["Event"];
	$DAYTIME = $row["DayTime"];
	$CONTACT = $row["Contact"];
      $DATE = $row["Date"];
	$TIME = $row["Time"];
     // $DATE = date("F j, Y", $DATE); // Displays ALL dates as January 1, 1970.



//$date = $row['date'];
//echo date("d.m.Y H:i:s", strtotime($date));

// *************** Begin Event Display **********************	
	echo "<center><h2><font color=#bca255>". date("F j, Y", strtotime($DATE)). "</font></h2><p><b>$DAYTIME @ <font color=#993399>$EVENT</font><br>in $LOCATION</b></center><hr><p><p>";
// *************** End Event Display ************************
}

//recordsetNav($mysql_link,$users_query,$PHP_SELF,$offset,$limit,'100%',1);
echo "<a href='mailto:staff@tgm.org?Subject=From TGM Speaking Schedule'>Email us for specific directions.</a>";

@mysql_close($mysql_link);
?>

 
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.