Select island
use DBI; our $dbh; our $dbfn; $dbfn= "/home/ijackson/things/ypp-sc-tools.pctb-dict-test/yarrg/OCEAN-Midnight.db"; $dbh=DBI->connect("dbi:SQLite:$dbfn",'','', { AutoCommit=>0, RaiseError=>1, ShowErrorStatement=>1, unicode=>1 }) or die "$dbfn $DBI::errstr ?"; # default timeout is 30s which is plenty my $sth=$dbh->prepare( "SELECT a.commodname,b.price,c.price,d.stallname,e.islandname FROM commods as a JOIN buy as b on a.commodid=b.commodid JOIN buy as c on a.commodid=c.commodid JOIN stalls as d on d.stallid=b.stallid JOIN islands as e on e.islandid=d.islandid WHERE a.commodname like 'Wood' "); $sth->execute(); % my @row; % while (@row=$sth->fetchrow_array) { % foreach my $cell (@row) { % } % }
<% $cell %>