i have a dynamic table whose values came from the database. the user will select records from the table then save the result to another table. i have the following code:
<?php
echo "<form method='post' action='save_result.php'>";
$subjects="table1";
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" .
realpath("data.mdb").";";
$conn=odbc_connect($connstr,'','')
or die("connect error: ".odbc_error());
$quey1="select * from $subjects";
$stmt=odbc_prepare($conn, $quey1) or die (Print "odbc prepare error".odbc_error());
$result=odbc_exec($conn,$quey1)
or die ("result error ".odbc_error().'-'.odbc_errormsg());
?>
<table border=1 style="background-color:#F0F8FF;" >
<caption><EM>Student Record</EM></caption>
<tr>
<th>Choose Subject</th>
<th>Subject Code</th>
<th>Description</th>
<th>Units</th>
</tr>
<?php
while($row=odbc_fetch_array($result)){
echo "</td><td>";
echo "<input type='checkbox' name='check[]'>";
echo "</td><td>
echo $row;
echo "</td><td>";
echo $row;
echo "</td><td>";
echo $row;
echo "</td></tr>";
}
?>
</table>
<input type="submit" value="next" name="next">
</form>
the code is working my problem is how to save the values to another table in the database after the user selects the subjects using the check boxes. can somebody help me!