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); ...
In reply to Logical question-to upate DB records by thisisperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |