Hi, im trying to use a drop down box to select data from my tables in my database that relate to just one column, which populates the drop down. I'm trying to display a drop down box full of race names pulled from a race table in my database, and this works fine, they're all listed correctly.

I want to then allow the user to select one, hit submit or whatever, then below, (OR on another page, I don't mind) in a table, display the member first and last names (from member table), the race date, length (from race table) and the result (from result table).

At the moment I'm stuck as whatever u select nothing happens. I'm really confused about how to get the race name from the submitted drop down, do you use get or post or what?? Need a simple explanation of what ive done wrong, I KNOW its wrong but just cant figure out how to fix it.. getting muddled !

Thanks, and here's my code:

Code:
here's my code:


Code:
<?php
require_once('connection.php');
if (!isset($_GET['race'])) {
	$res=mysql_query("select race_name from race");
		if(mysql_num_rows($res)==0) {
			echo "there is no data in table..";
		}
		else {
		echo'<form action="bugger.php" method="post"><select name="categories">';
			for($i=0;$i<mysql_num_rows($res);$i++) {
			$row=mysql_fetch_assoc($res);
			echo"<option>$row[race_name]</option>";
			} // endof for
		echo'</select><input type="submit" name="submit" value="race" />
		<input type="hidden" name="submitted" value="TRUE" /></form>';
		}
}
elseif ((isset($_GET['race']))) {
    	$getrace = $_GET['race'];
		$res=mysql_query("select member.first_name,member.last_name,race.race_name,race.race_date,results.time from member,race,result WHERE race.race_name='".$getrace."'");

		}
    
	if(mysql_num_rows($res)==0) {
		echo "there is no data in table..";
	}
	
	else {
		//table header
		echo'<table align="center" cellspacing="10" cellpadding="5">
		<tr><td align="left"><b>First Name</b></td>
		<td align="left"><b>Last Name</b></td>
		<td align="left"><b>Race Name</b></td>
		<td align="left"><b>Race Date</b></td>
		<td align="left"><b>Race Time</b></td></tr>';
    	echo'</select>';
    }
	// fetch and print all the records
	while($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
			echo'<tr><td align="left">'.$row['first_name'].'</td>
			<td align="left">'.$row['last_name'].'</td>
			<td align="left">'.$row['race_name'].'</td>
			<td align="left">'.$row['race_date'].'</td> 
			<td align="left">'.$row['time'].'</td>
			</tr>
			';}echo'</table>';

?>
i called the page bugger.php cos its just slightly annoying me! thanks for any help