I want to update a sql table based on which button was pushed from the corresponding row. Here is my table and sql query.
$STH10=$DBH->query(' SELECT * FROM equiplog');
print"<table>";
print"<form action='equipmentcalendar.pl' method='post'>";
while (@data = $STH10->fetchrow_array()) {
print "<tr>";
print "<td>$_</td>" for @data[1,2,3];
print "<td>";
print '<center>';
print button(
-name => 'returned',
-value => $data[0],
-label => 'returned'
);
print '<center>';
print "</td>";
print "</tr>";
}
print"</table>";
So when I push the returned button i would like a sql statement to update that row in my sql table. I dont really understand CGI that well and could use some help.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.