i have a mysql table that stores dates of events, and there are three columns that record the date. event_year, event_month, and event_day, respectivley, in a two-digit format. i don't have a problem sorting the query results chronologically, the trick is to skip events that have already past. the entries could be manually deleted, but i'm sure there's got to be a better way. here's my php file so far. oh, and by the way, the output is to a flash movie, if you were wondering.
<?
$host = "xxx.xx.xxx.xxx";
$user = "xxxxx";
$pass = "xxxxx";
$dbName = "xxxxx";
$tableName = "events";
$cYear = date(y);
$cMonth = date(m);
$cDay = date(d);
$link = mysql_connect ($host, $user, $pass);
$query = "SELECT * from $tableName ORDER BY event_year, event_month, event_day LIMIT 5";
$result = mysql_db_query($dbName, $query, $link);
$entry = 1;
while ($row = mysql_fetch_array($result)) {
$row[event_other] = nl2br($row[event_other]);
$events .= "&date0$entry=$row[event_month]/$row[event_day]/$row[event_year]&citystate0$entry=$row[event_city], $row[event_state]&venue0$entry=$row[event_venue]&contact0$entry=$row[event_contact]&other0$entry=$row[event_other]";
$entry = $entry + 1;
}
echo $events;
mysql_db_query($dbName, $query, $link);
mysql_close($link);
?>
initially i thought that i could just find the current year, month, and date and filter out < values, but obviously, if you think about it, that doesn't work. 01/01/03 comes after 09/09/02 but would be filtered out. i'm convinced the answer is obvious, but it's escaped me thusfar. i appologize if this has been answered before, i took a look but there's so much content to look through.
thanks.