Need to be able to have multiple selected="selected" in a list.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have a database with 1 to many and the many is a list with multiple
selects in a list.  When I click on a master record I have as part of
my form the select statement for the multiple choice list.  I want the
list to highlight the multiple chosen values.  here is part of the

$dresscat = specdresscat($dresstypeid); //this is the query to get the
values in the detail table
$drcatrow = pg_fetch_array($dresscat);// the array for the detail
<select name="stages[]" multiple="multiple">
 $allstages = allstages(); // this is a function to query my database
to get the value for the list.
while ($allstagerows=pg_fetch_array($allstages)) {
  $eachstage= $allstagerows["stageid"];
  $specstage= $drcatrow["stageid"]; // this is the point I need help
  if ($specstage ==  $eachstage){ ?>
<option value=<?php echo $eachstage;?> selected="selected"><?php echo
<?php }else{ ?>
<option value=<?php echo $eachstage;?>><?php echo

This is the select statement I have now.  I get the first falue to be
chosen but not the other values.

Site Timeline