i am fetching data to create a form that would later be updated via php into their individual mysql rows. Here is what i have tried so far and it isn't working.
$subj='1';
while($row=mysql_fetch_assoc($sql))
{
$go=mysql_query("select 1ca from result where subject_id='$subj' and student_id='$row[id]'"); $ca=mysql_fetch_assoc($go);
?>
<tr><td><input type="hidden" name="std_id[]" value="<?php echo $row['id']; ?> "/><?php echo $row['firstname']; ?> <?php echo $row['lastname']; ?></td>
<td><input type="text" name="ca1[]" value="<?php echo $ca['1ca']; ?>"/></td></tr>
<?php } ?>
and here is how I intend to process it so that each Students CA1 is updated accordingly
if(isset($_POST['submit']))
{
foreach($_POST['std_id'] as $student)
{
foreach ($_POST['ca1'] as $ca1)
{
}
mysql_query("update result set ca1='$ca1' where student_id='$student'");
}
}