I'm looping through a table to pull out job_id, job_title, job_position, and job_year variables, and then outputting the data into an editable HTML form, but through the loop the names of the text fields stay the same. This becomes problematic when I try to update any job listing after the first, when all the text fields, though echoing different values, are all being labeled in the same way.
Can anyone offer some advice on what the best way to get around this would be?
Here's my code:
<form action="detail.php?id=<? echo $id; ?>" method="post">
<?
while(list($job_id, $job_name, $job_position, $job_year)= mysql_fetch_row($job_result))
{
echo "Job name: <input type=\"text\" name=\"job_name\" value=\"$job_name\" /><br/>" .
"Position(s): <input type=\"text\" name=\"job_position\" value=\"$job_position\" /><br/>" .
"Year(s): <input type=\"text\" name=\"job_year\" value=\"$job_year\" /><hr/>";
}
mysql_free_result($job_result);
?>
<input type="submit" name="job_update" value="Update Job Info"/>