I have a script that pulls out data from the database into multiple textareas:
while($result = mysql_fetch_array($query))
{
echo "<textarea name=\"$entry[]\" cols=\"35\" rows=\"4\">$result[content]</textarea><br><br>";
}
Somewhere in the above, I need to include the field $result[bid], which is the unique id for each item -- I'm not sure how or where to do so.
After I update the multiple textareas generated from this query, I want to be able to hit submit, and have them update. I figure I have to do it with a foreach loop. Something like:
foreach($entry as $thing)
{
mysql_query("UPDATE nuke_today_block SET content = '$thing' WHERE bid = '$result[bid]'");
}
$result[bid] in the above should be the unique ID associated with each textarea. I can't seem to figure out how to a) associate that ID with each individual textarea, and b) carry it over into the foreach loop. Help?