I have a form that display data pulled from a table. It does this by:
$result=the result of my query...
while ($x = mysql_fetch_row ($result) )
{
?>
<td><input type="text" name="content[]" value="<?php echo $x[2]; ?>" size="15"><input type="hidden" name="contentid[]" value="<?php echo $x[0]; ?>">
}
This will post an array when the form is submitted. NOW...I need to extract the data in the array (as there are multiple records) and update each item in the array ($content) based on the ($contentid) which is also passed in an array.
This is how I started this venture:
if (@$update) // did the submit get clicked?
{
$content_array = implode (",",$content);
$contentid_array = implode (",",$contentid);
for each ($u as list($content_array) and $i as list($contentid_array))
{
$update_con_query="update table SET content='$u' WHERE contentid='$i' ";
$con_result=mysql_query($update_con_query);
}
}
This is not working, but I need to parse the first value in each of the arrays and then update the database based on the data.
Tough for me - maybe ez 4 u?
Thanks in advance!