PHP, MYSQL select box not selecting correctly
<p>Got another wierd one:</p>

<p>Here is my php:</p>

<pre><code>echo "&lt;/tr&gt;&lt;tr&gt;";
echo "&lt;td style='color:white;'&gt;".$row['iDesc']."&lt;/td&gt;&lt;td&gt;".$row['pCnt']."&lt;/td&gt;&lt;td style='color:".$color.";'&gt;".$row['pDur']."&lt;/td&gt;&lt;td&gt;".$row['pStr']."&lt;/td&gt;&lt;td&gt;".$row['pSpd']."&lt;/td&gt;&lt;td&gt;";
echo "&lt;select name='wield".$row['pNum']."' id='wield".$row['pNum']."' size='1' style='width: 100px;' onChange='wieldit(".$row['pNum'].");'&gt;";
echo "&lt;option value=0&gt;Use On";
$query = "Select item, iDesc from item where iType = 1";
$result2 = mysql_query($query, $_SESSION['connect']);
while ($row2 = mysql_fetch_array($result2)) {
  echo "&lt;option";
  echo " value=".$row2['item']."&gt;".$row2['iDesc']."&lt;/option&gt;";
}
echo "&lt;/select&gt;&lt;/td&gt;";
}
</code></pre>

<p>Here is my js:</p>

<pre><code>function wieldit(num) {
    var id = "wield"+num;
    var e = $(id); 
    var t =  e.options[e.selectedIndex].value;
    var params = "sWield="+t;
    params += "&amp;sNum="+num;
    new Ajax.Updater('div06', 'php/pack.php', {method: 'get', parameters: params, onComplete: showBody});
}
</code></pre>

<p>When I run it the values in the select box are 0, 1, 2, 26, 25,24, 23, 31. For the example I'm running $row['pNum'] = 6 and I'm selecting select value 31. When I do alert on params in the js sWield = 0 and sNum = 6. The thing is, sWield should be 31. Ideas?. If I run with different values, say $row['pNum'] = 11 and select value 25 in the js sWield = 25 and sNum is 11 the way it should be. Ideas?</p>
