update mysql table with list values
<p>i have a form that extract data from mysql table into a form, each row has a menu to choose a value from and i want to update mysql with each value choosen for each row when the 'Apply To All' button is clicked but doesnt work at all.,here is my code.</p>

<pre><code>&lt;td&gt;&lt;form id="main" name="main" method="post" action="setProjectStatus.php" onsubmit="return validateMain();"&gt;
      &lt;table width="100%" cellspacing="1" cellpadding="1"&gt;
        &lt;tr&gt;
          &lt;td width="35%" rowspan="3"&gt;&lt;img src="../img/project.jpg" alt="Comp Sci Stud" width="325" height="199" border="2" /&gt;&lt;/td&gt;
          &lt;td width="65%" height="42" colspan="2"&gt;&lt;table width="94%" cellpadding="1" cellspacing="1" class="main_table"&gt;
            &lt;tr class="table_title"&gt;
              &lt;td width="100%" class="table_title"&gt;Set Project Status. &lt;/td&gt;
              &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td height="26"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td height="26"&gt;&lt;table width="100%" cellspacing="1" cellpadding="1"&gt;
                &lt;tr class="table_head"&gt;
                  &lt;td width="2%" height="35"&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;
                  &lt;td width="26%" height="35"&gt;&lt;div align="center"&gt;Student Name&lt;/div&gt;&lt;/td&gt;
                  &lt;td colspan="2"&gt;&lt;div align="center"&gt;Project&lt;/div&gt;&lt;/td&gt;
                  &lt;td width="19%"&gt;&lt;div align="center"&gt;Status&lt;/div&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php
 session_start();
 $username = $_SESSION['username'];

 require_once("mysqlConnect.php"); 

//
$sql="SELECT * FROM spms_Student";
$result=mysql_query($sql);
$count=mysql_num_rows($result);

echo "There are $count projects to be undertaken.";
while($rows=mysql_fetch_array($result)){
//
$query = "SELECT name FROM spms_systemUser WHERE userId = '".$rows[0]."'";
$result1 = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result1);
$name = $row[0];
?&gt;

                &lt;tr&gt;
                  &lt;td height="25" align="center"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td align="center"&gt;&lt;?php echo $name; ?&gt;&lt;/td&gt;
                  &lt;td colspan="2" align="center"&gt;&lt;?php echo $rows[1]; ?&gt;&lt;/td&gt;
                  &lt;td align="center"&gt;&lt;label&gt;
                    &lt;select name="select" class="form_field_100px_select"&gt;
                      &lt;option value="Pending" selected="selected"&gt;Pending&lt;/option&gt;
                      &lt;option value="Approved"&gt;Approved&lt;/option&gt;
                      &lt;option value="Disapproved"&gt;Disapproved&lt;/option&gt;
                    &lt;/select&gt;
                  &lt;/label&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php
}
?&gt;
                &lt;tr class="pager_bg"&gt;
                  &lt;td height="35"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td width="37%" align="right"&gt;&lt;input name="done" type="button" id="done" value="Done" onclick="window.location='../coordinatorMenu.html'" /&gt;&lt;/td&gt;
                  &lt;td width="16%"&gt;&lt;label&gt;
                    &lt;input name="approveAll" type="submit" id="approveAll" value="Approve All" /&gt;
                  &lt;/label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input name="apply" type="submit" id="apply" value="Apply To All" /&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php
mysql_close();
?&gt;
              &lt;/table&gt;&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/table&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;/tr&gt;

        &lt;tr&gt;
          &lt;td colspan="2"&gt;&lt;label&gt;&lt;/label&gt;            &lt;label&gt;&lt;/label&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;&lt;/td&gt;
</code></pre>
