I am very new to php and i would appreciate a little help with something. I would like to keep this as simple as possible. I am designing a website for my kids wrestling team and on the home page i have a simple php set up to display one event from the events table of the mysql db. Currently it is set to ORDER BY eventdate, which is a DATE field of the db. can someone please help me figure out how to display the next upcoming date rather than the highest date in the db.
The code I am using is as follows
<?php
mysql_connect("mysql","user","password");
mysql_select_db("braves");
$query ="SELECT eventtitle, eventbody, eventtime, eventsub, weighin, directions,";
$query.=" DATE_FORMAT(eventdate, '%M %d, %Y') AS date";
$query.=" FROM events ORDER BY eventdate DESC LIMIT 1";
$result=mysql_query($query);
while (list($eventtitle,$eventbody,$eventtime,$eventsub,$weighin,$directions,$eventdate,) =
mysql_fetch_row($result)) {
echo "<dt><b><h1>$eventtitle </h1></b></dt>";
echo "<dd><b><h2>$eventsub </h2></b></dd>";
echo "<dd><b><h3>($eventdate)</h3></b></dd>";
echo "<dd><b><h3>$eventtime</h3></b></dd>";
echo "<dd><b><h4>$weighin</h4></b></dd>";
echo "<dd> </dd>";
echo "<dd>$eventbody</dd>";
echo "<dd> </dd>";
echo "<dd>$directions</dd>";
echo "<dd> </dd>";
echo "<dd> </dd>";
}
?>
I'm sure that the code above is not the best it could be but as I said I am very new to this, Thanks in advance for any help you can give.
~Zach