X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_commod;h=c801a631e65855d4e762aa247bb702bf883ecfc1;hp=3b2bf3554533f40a334d63690dac86f023b16764;hb=19669922dd2393c23371ee1532824e528b897de0;hpb=aa69f9268584bedbdbdf5d0d51e2ce78b9ecd330
diff --git a/yarrg/web/query_commod b/yarrg/web/query_commod
index 3b2bf35..c801a63 100644
--- a/yarrg/web/query_commod
+++ b/yarrg/web/query_commod
@@ -50,6 +50,7 @@ my ($commodname,$cmid);
my $qa= \%ARGS;
%perl>
+
Commodity enquiry
% $prselector->('BuySell');
@@ -69,10 +70,13 @@ my $qa= \%ARGS;
%#========== results ==========
+
+
<%perl>
$emsgokorprint->($emsg) or $cmid=undef;
-return unless defined $cmid;
+print("
"), return
+ unless defined $cmid;
$someresults->();
#---------- actually compute the results and print them ----------
@@ -95,7 +99,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
my $offers= $dbh->prepare(
"SELECT stallname, price, qty
- FROM $bs NATURAL JOIN stalls
+ FROM $bs JOIN stalls USING (stallid, islandid)
WHERE commodid = ? AND islandid = ?
ORDER BY price $ascdesc"
);
@@ -109,7 +113,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
% my $rowix= 0;
% while ($island= $islands->fetchrow_hashref) {
% if (!$rowix) {
-
+
@@ -212,3 +216,4 @@ No offers.
<%perl>
}
%perl>
+