chiark / gitweb /
yarrg database code: eliminate all NATURAL JOINs and turn them into JOIN USING
[ypp-sc-tools.main.git] / yarrg / web / query_commod
index 153ea792c92e7f9abcc9eac7472d37c72bdb7fca..c801a631e65855d4e762aa247bb702bf883ecfc1 100644 (file)
@@ -75,7 +75,8 @@ my $qa= \%ARGS;
 <%perl>
 
 $emsgokorprint->($emsg) or $cmid=undef;
-return unless defined $cmid;
+print("</div>"), return
+       unless defined $cmid;
 $someresults->();
 
 #---------- actually compute the results and print them ----------
@@ -98,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"
                );
@@ -215,3 +216,4 @@ No offers.
 <%perl>
 }
 </%perl>
+</div>