Hello, I have recently being coding a sailing results, and I have a page where you can select a series and all the races from this series come up.
This is what selects the list of series:
Code: Select all
$query=mysql_query("SELECT * FROM series") or die(mysql_error());
while($array=mysql_fetch_array($query))
{
echo("
<option>$array[name]</option>
") ;
}
this is what selects the year:
Code: Select all
$query=mysql_query("SELECT * FROM series_years") or die(mysql_error());
while($array=mysql_fetch_array($query))
{
echo("
<option>$array[year]</option>
") ;
}
This then post two variables, series and year. Any races from this series and year are then fetched from the database. At the moment, the selected option is
not the same as the one th user is viewing. For example, the user might be looking at Autumn 2009, when the selection boxes say Summer 2008. Is there anyway of keeping the default selected option the same as what the user is viewing?