Right I get what you mean now.
You could output each field with the emp_id attached to the field name then read each one back with a variable variable name. That sounds a little complex so I shall demonstrate
Assuming that you use a loop to ouotput the fields and there names you could do something like
while(... )
{
echo "<tr>\n";
echo "<td><input type=\"hidden\" name=\"emp_id[]\" value=\"".$row[EMP_ID]."\">".$row[EMP_ID]."</td>\n";
echo "<td><input name=\"hours".$rows[EMP_ID]."\" type=\"text\" value=\"".$row[HOURS]."\" >
<td>\n";
}
so if you had employee numbers
00001
00002
00003
00004
00005
You would get field names of
hours00001
hours00002
hours00003
hours00004
hours00005
To get these into the database you could use
for ( $loop=0; $loop<$POST['emp_id']; $loop++ )
{
$varname="hours".$POST['emp_id[$loop]'];
$query="replace into tbl_employee values (".$emp_id.",".${$varname}.")";
// database stuff
}
This would update the record with the emp_id with the value from the variable hours00001.
Hows that?
Mark.