in reply to collect all numeric form params and update database
# assuming $cgi = new CGI; # prepare update query my $sth = $dbh->prepare(' update pic_table set pic_value=? where pic_i +d=? '); # loop over all param names, and # grep out all those that are numerical foreach my $p( grep /^\d+$/, $cgi->param) { # find the form value my $v = $cgi->param( $p ); # execute the query $sth->execute( $v, $p ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: collect all numeric form params and update database
by Anonymous Monk on Mar 06, 2006 at 01:32 UTC | |
by rhesa (Vicar) on Mar 06, 2006 at 01:34 UTC |