Ok this is a pretty big problem for me (but it could be simple for someone with a lot of experience with php maybe?), just explaining it is gonna be a little tricky, so please bear with me as I try...

The website if for a rugby club. They have 7 teams (or team_types - see below).
Ok this is what i have:
A database (lets say its called mydatabase) with a table called fixtures. The fields of the table are (among others):
team_type (1st team, 2nd team, 3rd team, 4th team, under 18, under 15, under 13, under 11)
match_type (league, cup, friendly)
date_and_time (date and time of fixture. eg: 2009-05-23 12:30:00)
home_team (name of the home team [obviously can be the name of this club itself])
away_team (name of away team [obviously can be the name of this club itself])
Ok now to what I want to be able to do. On th home page, I have small sections like this (one for each team):
Next 1st XI GameDate: <Display the date of the match here>
Oppositon: <Display the name of the opposing team>
Type: <Display the type of match>
Home/Away: <Display if the match is home or away>
Basically what I want do do is this.
1. I need to be able to connect to the databse.
2. Retrieve the details of the match that is closest to current date and time but in the future. I know this probably sounds wrong but let me try to explain.
Right say today's date and time is
2009-04-25 15:00:00.
Say the fixtures table has 3 games:
a. 2009-04-24 12:00:00 (yesterday)
b. 2009-04-25 10:00:00 (today but earlier in the day)
c. 2009-04-28 12:00:00 (3 days from today).
In this case I would need to ensure that the match chosen is the one 3 days from the current date and time and not:
a. As this match was yesterday.
b. As the start time for this game has already passed.
3. Display the details of each teams matches in each team's relevant section as described above.
Any help would be very very much appreciated.
Cheers....