I am new to php and mysql. 😕 I am doing a website for a friend. The site contains sports event stats.
He wants to have on the mainpage a calendar of events for that year and winners. I have created a table for all events which has the date of the event. What he wants is to have the date for the event and once the event goes passed the date it lists the information from the database.
I'm working with Dreamweaver MX using templates. A sample of the code for listing the winner is as follows. It is a horse race that has run for more than a hundred years. The table contains year, winner, second, third, jockey and trainer for each year. The recordset is called AR_MELBCUP.
mysql_select_db($database_SS_SPORTS, $SS_SPORTS);
$query_AR_MELBCUP = "SELECT First FROM AR_MelbCup ORDER BY Year DESC";
$AR_MELBCUP = mysql_query($query_AR_MELBCUP, $SS_SPORTS) or die(mysql_error());
$row_AR_MELBCUP = mysql_fetch_assoc($AR_MELBCUP);
$totalRows_AR_MELBCUP = mysql_num_rows($AR_MELBCUP);
The dates of events is kept in a table called 'Calender'. For the above example, under the column of Melb_Cup the date is 2004-11-02.
When the main page loads, under Melbourne Cup until Nov 2 it lists the date of event from Calendar table, after Nov 2 it lists the info from the AR_MelbCup table.
Can anyone help with code to make this happen. I must be missing something. I'm still on training wheels. I have not included any of my efforts.
Cheers Peter