You have your DB iterator
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
and inside this iterator you generate select box markup
<select name="<?=$objResult[" pidx="];?>"></select>
According to if criteria, you will create one select per each row.
Consider refactoring the code, by moving select tag generation outside of the items loop.