PHP not updating select boxes correctly
<p>Here is another one. Twice in the same day. I'm trying to set up 4 select boxes that shows a option selected based the values in Target1-4 if they are equal to the value of enSlot.</p>

<pre><code>echo "&lt;select id='target".$row['paSlot']."' size='1' style='width:90px;'&gt;";
$query = "SELECT * FROM enemy WHERE enChar = ".$_SESSION['chNum']." ORDER BY enSlot";
$result1 = mysql_query($query, $_SESSION['connect']) or die('Error 150: '.mysql_error());
while ($row1 = mysql_fetch_array($result1)) {
    $s = "";
    if ($_GET['Target1'] == $row1['enSlot']) {
            $s = "selected='selected'";
    }
    if ($_GET['Target2'] == $row1['enSlot']) {
            $s = "selected='selected'";
    }
    if ($_GET['Target3'] == $row1['enSlot']) {
            $s = "selected='selected'";
    }
    if ($_GET['Target4'] == $row1['enSlot']) {
            $s = "selected='selected'";
    }
    echo "&lt;option value=".$row1['enSlot']." ".$s."&gt;".$row1['enSlot'].". ".$row1['enRace'];
}
echo "&lt;/select&gt;";
</code></pre>

<p>I run it with this:</p>

<p>Target1 = 1, Target2 = 2, Target3 = 3, Target4 = 4
Enemy has 4 records, enSlot = 1 - 4</p>

<p>When it executes I get all 4 select boxes show the last value of Target4 being selected.</p>
