thisisperl has asked for the wisdom of the Perl Monks concerning the following question:
Fields that can be modified are displayed as text boxes. In addition, next to each row, an update button is also displayed. So a user could modify the value in a text box and click the Update button for that row. eg:my $rows = $dbh->selectall_arrayref($SQL,{Columns =>{}}) ; $template->param(ROWS => $rows || []);
If 5 rows are displayed, there would be 5 Update buttons-one for each row. What is happening is that the Update button works only for the first row. How can I associate each Update button with the corressponding row? Here's the Perl script called when the Update button is clicked(scaled down version):<!-- TMPL_LOOP NAME=ROWS --> <tr> . . . <td> <input type="text" value = "<!-- TMPL_VAR NAME=Detail -->" size="43" n +ame="Detail"> </td> <td> <input type="submit" value="Update"> </td> </tr> <!-- /TMPL_LOOP -->
Thanks!$ticket = $query->param('TicketNo'); $detail = $query->param('Detail'); . . . my $temp1 = "UPDATE TSIssuesTable "; my $temp2 = "SET Detail = ?"; my $temp3 = "WHERE "; my $temp4 = "TicketNo = $ticket"; $SQL = $temp1.$temp2.$temp3.$temp4; $sth1 = $dbh->prepare( $SQL ); $sth1->execute($details); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Logical question-to upate DB records
by etcshadow (Priest) on Jun 01, 2004 at 18:25 UTC | |
|
Re: Logical question-to upate DB records
by gowen (Initiate) on Jun 01, 2004 at 20:09 UTC | |
by BUU (Prior) on Jun 01, 2004 at 21:14 UTC | |
by gowen (Initiate) on Jun 17, 2004 at 20:05 UTC | |
by thisisperl (Novice) on Jun 01, 2004 at 21:20 UTC | |
by IOrdy (Friar) on Jun 02, 2004 at 00:32 UTC | |
by thisisperl (Novice) on Jun 02, 2004 at 17:14 UTC |