If statement errors

Can someone please help me with the following code?
The function works etc but the part that is causing the errors is the selected bit.
The selected part is based on the url ie if the url is index.php?make=Apolo then Apolo option should be shown as the selected option in the echoed select menu.

What the script seems to be doing is it gets to the option that should be shown as selected, sets it as selected but also sets all the options thereafter it in the list to selected aswell!!

Any ideas whats wrong with the code and how to fix it please would be really helpful.

function getTierOne()
$result = mysql_query(“SELECT DISTINCT Make FROM Stock WHERE Type=‘2’ ORDER BY Make ASC”)
or die(mysql_error());

  while($tier = mysql_fetch_array( $result )) 
  if($tier['Make'] == $_REQUEST['make']) { $mine = 'selected';}		
	   echo '<option value="'.$tier['Make'].'" selected="'.$mine.'">'.$tier['Make'].'</option>';


After you set $mine = ‘selected’, $mine has the value of ‘selected’. The variable won’t forget its value; that’d defeat the purpose of having variables to remember things. It will still be ‘selected’ next time you echo it, and the next time, and the next time.

if ($tier['Make'] == $_REQUEST['make']) {
    $mine = 'selected';
} else {
    $mine = '';

Thanks for the reply, just realised my mistake aswell. Appreciate the help once again. :slight_smile: