At 10:07 15-1-03, you wrote:
I have table with six records in it. I can use "while" to display them all,
but in form. Is there any way I can edit all six records, and update them
all with one submit.
One of the many ways to do it:
When writing the form, number the fieldnames with the ID's of the items. Separate name and ID with a clear character like '__'
<input type="text" name="field__531">
<input type="text" name="field__532">
<input type="text" name="field__533">

In the receiving page, split the name again.
Then build a query for every record. I'm not sure whether you can string multiple queries, separated by a semicolon (;), have a try.

this is a principle code (not working but it shows the idea) for checking every incoming variable

for [each $key, $value in $_POST]
{if (! strpos('field',$key)==false)
{ $key=explode('__',$key);
$ID=$key[1];
mysql_query(UPDATE mytable SET WHERE ID=$ID)
}
}




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to