I am trying to creating a table where you can select a checkbox to select a row of data and send the data to a form. So far I have gotten the dynamic checkboxes working so I can select a row of data. However, I am having trouble recovering the data when my data has been submitted. Here is my table code:
<?php
require('dbconnect.php');
$line= 0;
$sql="SELECT * FROM timeData WHERE login = '$loginId'";
$result = mysql_query($sql) or die("Query Failed");
while($row = mysql_fetch_assoc($result)) {
echo "<tr>
<td>
<input type='checkbox' name='F1[]' value='$i'>
<input type='hidden' name='F2[]' value='$row[id]'>
<input type='hidden' name='F3[]' value='$row[mdate]'>
<input type='hidden' name='F4[]' value='$row[tIn]'>
<input type='hidden' name='F5[]' value='$row[tOut]'>
</td>
<td>$row[id]</td>
<td>$row[mDate]</td>
<td>$row[tIn]</td>
<td>$row[tOut]</td>
</tr>";
$line++;
}
?>
And Here is my data retrieval code just to see the data:
<?php
session_start();
$line = $_POST['F1'];
$id = $_POST['F2'];
$mDate = $_POST['F3'];
$tIn = $_POST['F4'];
$tOut = $_POST['F5'];
echo "<br/>".$line;
echo "<br/>".$id;
echo "<br/>".$mDate;
echo "<br/>".$tIn;
echo "<br/>".$tOut;
?>
Thanks in Advance
This is what the table and retrieval page should looks like: