Posted: Mon Aug 06, 2007 6:00 pm
In the database make sure the 'match_date' field is set to data type 'DATE'.
When entering match_date into the database format the date correctly.
To delete anyting prior to today (if you really want to) see earlier post with code in it.
Or instead of deleting it change the mysql query to only show matches today or in the future:
When entering match_date into the database format the date correctly.
To delete anyting prior to today (if you really want to) see earlier post with code in it.
Or instead of deleting it change the mysql query to only show matches today or in the future:
Code: Select all
//connect to server and select database
$con = mysql_connect($servername, $username, $password);
if (!$con)
{
die('Could not connect :' . mysql_error());
}
//select database
mysql_select_db($database, $con);
//create and execute query
$sql="SELECT * FROM ".$table." WHERE match_date>=CURDATE() ORDER BY match_date ASC";
$result=mysql_query($sql);
//iterate through resulting rows
while($row=mysql_fetch_array($result))
{
echo $row['match_name']." ".$row['match_date']." ".$row['match_time']." ".$row['match_venue']."<br>";
}