Hi, i've got three tables, member, race and results.
Member primary key is member_no, race is race_no and results is a composite of race_no and member_no.
Basically I want a page where users can view race results - i.e. show the members first name and last name (from member table), the race name, race date, race length (from race table), and the result (which is a time, from results table). I want to display all this as column headings and output the relevant data just in a table.
BUT, i want to allow the user to be able to view results for certain races, so i thought having a drop down box with race names in then somehow reloading the page and displaying just results for that race name would be the most suitable way.
All i've managed to do so far is get a drop down box with the race names in however - eek! i have done the join query yet to get all the data as I was experiementing, i selected everything from race table and stuck the race_name in the combo box, but do i just output the other fields into rows or something in the table? how??
this is my miniscule amount of code so far..
<?php
require_once('connection.php');
echo'<select name="categories">';
$res=mysql_query("select * from race");
if(mysql_num_rows($res)==0) echo "there is no data in table..";
else
for($i=0;$i<mysql_num_rows($res);$i++) {
$row=mysql_fetch_assoc($res);
echo"<option>$row[race_name]</option>";
}
echo'</select>';
?>
How can i go about making this page how I want? This has been confusing me for days as it surely can't be that hard, i've searched online for hours but not found anything just like i want.
Thanks