[56K WARN] Updating textarea in a Table
Posted: Sun May 20, 2007 6:27 pm
I have the table look like 
My problem is I cannot get the "Job Gossip" column to update correctly. It doesn't matter what I enter for Jobs 39 and 40, they repeat the gossip from Jobs 35 and 36.
The code that produced the table:
When the update button is clicked, it calls:
(I've omitted the lines that connects to the database).
I cannot seem to find where the bug is unfortunately. Any help would be greatly appreciated.

My problem is I cannot get the "Job Gossip" column to update correctly. It doesn't matter what I enter for Jobs 39 and 40, they repeat the gossip from Jobs 35 and 36.
The code that produced the table:
Code: Select all
$i = 0;
foreach ($get_info as $field) {
echo "<td><font face=arial size=1>";
if($i==0){
echo "<input name='jobID[]' value='$field' type='checkbox'>";
}
if($i==7) {
echo "<textarea name='gossip[]'>$field</textarea>";
}
else {echo $field;}
echo "</font></td>";
$i++;
}Code: Select all
$jobID = $_POST["jobID"];
$workerID = $_POST["workerID"];
$gossip = $_POST["gossip"];
for($i = 0; $i < count($jobID); $i++) {
$update = "UPDATE job SET jobGossip = '".$gossip[$i]."' WHERE jobID = ".$jobID[$i];
echo $update;
$updateStatus = mysql_query($update,$link) or die("Update jobStatus Failed");
}I cannot seem to find where the bug is unfortunately. Any help would be greatly appreciated.