%perl> # views currency data my $data_structure = $m->comp('/comp/get_currency.mas'); print"
| Currency | Cid |
|---|---|
| ".# data?." | \n"; print "\t".# data?." | \n"; print "
##
<%args>
$cid => 0
%args>
<%perl>
# if a currency to edit was passed to this form then
# get the data and place in the form.
# otherwise present a blank form
my $data_structure = $m->comp('/comp/get_currency',
cid => $cid);
%perl>
Make a new currency entry
<& /view_currency.html &>
####
%perl>
# get data requested and return
my ($statement, $sth, $ref);
$statement = 'SELECT
cid,
currency
FROM currency ORDER BY currency;';
$sth = $dbh->prepare($statement) or die "Couldn't prepare statement: $dbh->errstr";
$sth->execute or die "Couldn't execute statement: $dbh->errstr";
while ($ref = $sth->fetchrow_hashref){
# store one or more rows of data in a structure
}
return $data_structure
%perl>