3 <TITLE>test pirate page</TITLE>
7 <html><head><title>Select island</title></head><body>
8 <form action="/ucgi/~clareb/mason/something" method="get">
9 <select name="islandid">
11 my $sth=$dbh->prepare("SELECT islandid,archipelago,islandname
13 ORDER BY archipelago,islandname;");
17 % while ($row=$sth->fetchrow_hashref) {
18 <option value="<% $row->{'islandid'} |h %>"><% $row->{'archipelago'} |h %> -
19 <% $row->{'islandname'} |h %>
21 <input type=submit name=submit value="Go">
29 $dbfn= "/home/ijackson/things/ypp-sc-tools.pctb-dict-test/yarrg/OCEAN-Midnight.db";
30 $dbh=DBI->connect("dbi:SQLite:$dbfn",'','',
32 RaiseError=>1, ShowErrorStatement=>1,
34 or die "$dbfn $DBI::errstr ?";
35 # default timeout is 30s which is plenty
37 my $sth=$dbh->prepare(
38 "SELECT a.commodname,b.price,c.price,d.stallname,e.islandname
40 JOIN buy as b on a.commodid=b.commodid
41 JOIN buy as c on a.commodid=c.commodid
42 JOIN stalls as d on d.stallid=b.stallid
43 JOIN islands as e on e.islandid=d.islandid
44 WHERE a.commodname like 'Wood'
49 <table frame=box rules=all>
51 <tr><td>Island</td><td>Arch</td><td>Stall</td><td>buy price</td><td>sell price</td></tr>
54 % while (@row=$sth->fetchrow_array) {
56 % foreach my $cell (@row) {