link checkbox to table row information
<p>i have a form which retrieve students project values from mysql,,these values are led by a checkbox, so i want to assign supervisors to students with a checked box, that is check a checkbox that correspond to a student you want to assign supervisor to and click Assign Supervisor button to enter supervisor name then that supervisor is allocated to the checked student but it doesnt work,,plis help....   </p>

<pre><code>&lt;?php
 $dbhost = 'dbhost';

 $dbuser = 'user';

 $dbpass = 'password';

 $dbname = 'db_name';

 $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
 //
 mysql_select_db($dbname,$conn) or die ("Could not open database");
 //
$sql="SELECT * FROM table";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;student.to.assign.supervisor&lt;/title&gt;
&lt;style type="text/css"&gt;
&lt;!--
.style2 {font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: bold;
    font-style: italic;
    font-size: 18px;
}
--&gt;
&lt;/style&gt;
&lt;link href="../css/forms.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="75%" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC"&gt;
  &lt;tr&gt;
    &lt;td height="51"&gt;&lt;div align="center"&gt;
      &lt;p class="style2"&gt;Student Project Management System&lt;/p&gt;
      &lt;p class="style2"&gt; with Web Front End &lt;/p&gt;
    &lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;hr /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;form action="" method="post" name="form2" id="form2"&gt;
      &lt;table width="100%" cellspacing="1" cellpadding="1"&gt;
        &lt;tr&gt;
          &lt;td width="77%"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;td width="10%"&gt;&lt;label&gt;
            &lt;input type="submit" name="Submit" value="Logout" /&gt;
          &lt;/label&gt;&lt;/td&gt;
          &lt;td width="13%"&gt;&lt;label&gt;
            &lt;input type="submit" name="Submit3" value="About Us" /&gt;
          &lt;/label&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;hr /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;form id="form3" name="form3" method="post" action=""&gt;
      &lt;table width="100%" cellspacing="1" cellpadding="1"&gt;
        &lt;tr&gt;
          &lt;td width="35%" rowspan="2"&gt;&lt;label&gt;
            &lt;input type="image" name="imageField" src="../img/project.jpg"  width="325" height="199" border="2" /&gt;
          &lt;/label&gt;&lt;/td&gt;
          &lt;td width="65%"&gt;&lt;table width="94%" cellpadding="1" cellspacing="1" class="main_table"&gt;
            &lt;tr class="table_title"&gt;
              &lt;td width="100%" height="31"&gt;Students, their Proposed Project and Supervisors &lt;/td&gt;
              &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;table width="100%" cellspacing="1" cellpadding="1"&gt;
                &lt;tr class="table_head"&gt;
                  &lt;td width="3%" height="42"&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;
                  &lt;td width="32%"&gt;&lt;div align="center"&gt;Name&lt;/div&gt;&lt;/td&gt;
                  &lt;td width="36%"&gt;&lt;div align="center"&gt;Project Proposed&lt;/div&gt;&lt;/td&gt;
                  &lt;td width="29%"&gt;&lt;div align="center"&gt;Supervised By&lt;/div&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php
while($rows=mysql_fetch_array($result)){
?&gt;
                &lt;tr&gt;
                  &lt;td&gt;&lt;div align="center"&gt;
                    &lt;input type="checkbox" name="checkbox[]" id="checkbox[]" value="&lt;?php echo $rows['username']; ?&gt;" /&gt;
                  &lt;/div&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;div align="center"&gt;&lt;?php echo $rows[0]; ?&gt;&lt;/div&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;div align="center"&gt;&lt;?php echo $rows[1]; ?&gt;&lt;/div&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;div align="center"&gt;&lt;?php echo $rows[2]; ?&gt;&lt;/div&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php
}
?&gt;
              &lt;/table&gt;
              &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="21"&gt;&lt;form id="form1" name="form1" method="post" action="../coordinatorAssignSupervisor2.html"&gt;
      &lt;table width="100%" cellspacing="1" cellpadding="1"&gt;
        &lt;tr&gt;
          &lt;td width="81%"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;td width="1%"&gt;&lt;label&gt;&lt;/label&gt;&lt;/td&gt;
          &lt;td width="18%"&gt;&lt;input name="AssignSupervisor" type="submit" id="propose" value="Assign Supervisor" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
&lt;?php

}
mysql_close();
?&gt;
      &lt;/table&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
