X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fprofitable_trades;fp=yarrg%2Fweb%2Fprofitable_trades;h=6aab676d4fee0e27b38f79c78738edf5b883ecfc;hp=0000000000000000000000000000000000000000;hb=4c0fe82716fdf19f385f1f190de80beb6ea3c9c4;hpb=dbd70ca20132a55c55b5d876b59a85d10f9cdd25 diff --git a/yarrg/web/profitable_trades b/yarrg/web/profitable_trades new file mode 100755 index 0000000..6aab676 --- /dev/null +++ b/yarrg/web/profitable_trades @@ -0,0 +1,46 @@ + + +test pirate page + + + +Profitable trades +<%perl> +my $sth=$dbh->prepare( + "SELECT commods.commodname, + sell_islands.islandname,sell_stalls.stallname,sell.price,sell.qty, + buy_islands.islandname,buy_stalls.stallname,buy.price,buy.qty + FROM commods + JOIN buy on commods.commodid=buy.commodid + JOIN sell on commods.commodid=sell.commodid + JOIN islands as buy_islands on buy.islandid = buy_islands.islandid + JOIN stalls as buy_stalls on buy.stallid = buy_stalls.stallid + JOIN islands as sell_islands on sell.islandid = sell_islands.islandid + JOIN stalls as sell_stalls on sell.stallid = sell_stalls.stallid + WHERE buy.islandid like '36' and sell.islandid like '5' + and buy.price > sell.price + "); + +$sth->execute(); + + + +% my @row; +% while (@row=$sth->fetchrow_array) { + +% foreach my $cell (@row) { + +% } + +% } +
commodbuy islandbuy stallbuy pricebuy quantitysell islandsell stallsell pricesell qty
+<% $cell %> +
+ + + + +<%init> +use CommodsWeb; +my $dbh= dbw_connect('Midnight'); +