Update Multiple Records From Form
| From: | Albert Padley | Date: | Fri, 28 May 2004 03:46:48 +0000 |
| Subject: | Update Multiple Records From Form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-187085@lists.php.net to get a copy of this message | ||
I feel I'm so close.
I have a form with multiple database records with a checkbox to indicate which records to update set up like so:
$name = "ed[" . $row['id'] . "]";
<input type=\"checkbox\" name=\"" . $name . "\" value=\"Y\">
Each text input is set up like so:
<input type=\text\" name=\"fname[]\" value=\"" . $row['fname'] . "\">
On the processing page I am doing this:
foreach($ed as $id=>$val){
$query = "UPDATE ref_events_regSET fname = '$fname' WHERE id = '{$id}'"; I am looping through the correct records, but every field is being updated to "Array". What tweak do I need to make? Thanks. Albert Padley