Hi I'm working on an Event Listings system (PHP + MySQL). It's working great now, but there is one thing left I need it to do, and I have no idea how to do it.
I want to be able to return only details of the NEXT date in the calendar.
Currently I'm doing this to list all the events:
<?php
$dbh = mysql_connect ("localhost", "x", "x") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("x") or die (mysql_error());
$result = mysql_query ("SELECT * FROM calendar WHERE 1 ORDER BY FDATE ASC", $dbh);
?>
<?php
$rows = mysql_num_rows ($result);
for ($row= 0; $row < $rows; $row++)
{
echo "...
FDATE is the standard 2003-31-12 format.
It needs to skip passed events and show just the next.
Can it be done? 😕 Help really appreciated. 🙂