Hi all,
 
I need to present a series of database fields for users to update and when
the form is submitted I need to be able to retrieve not only the field
values but the original row ID's as well so I'll know which table rows to
update. 
 
What I'd like to be able do is name the form fields as array elements:
 
     <form>
     <input type="text" name="question{'25'}" value="$answer{'25'}">
     <input type="text" name="question{'47'}" value="$answer{'47'}">
     </form>
 
Then when the form came back in, create update statements from the key/value
pairs.
 
     while (($key,$value) = each %question) {
          $query = "UPDATE tablename SET answer = '$value' WHERE id = '$key'
";
     } 
 
Does that make any sense at all? Can someone tell me how I'd do that in
PERL?
 
Thanks,
Chuck Mayo
 

Reply via email to