From: Ian Jackson Date: Sat, 22 Aug 2009 12:35:28 +0000 (+0100) Subject: New dumpqueryresults component for handy debugging etc. X-Git-Tag: 3.4~153 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=da8db80459e25a474b545779db3fcd0304e68325 New dumpqueryresults component for handy debugging etc. --- diff --git a/yarrg/web/dumpqueryresults b/yarrg/web/dumpqueryresults new file mode 100644 index 0000000..c653d81 --- /dev/null +++ b/yarrg/web/dumpqueryresults @@ -0,0 +1,20 @@ +<%args> +$sth + + + +% foreach my $field (@{ $sth->{NAME} }) { + +% my @row; +% while (@row=$sth->fetchrow_array) { + +% foreach my $cell (@row) { + +% } + +% } +
<% $field |h %> +% } +
+<% $cell |h %> +
diff --git a/yarrg/web/profitable_trades b/yarrg/web/profitable_trades index 6aab676..1566baf 100755 --- a/yarrg/web/profitable_trades +++ b/yarrg/web/profitable_trades @@ -23,19 +23,7 @@ my $sth=$dbh->prepare( $sth->execute(); - - -% my @row; -% while (@row=$sth->fetchrow_array) { - -% foreach my $cell (@row) { - -% } - -% } -
commodbuy islandbuy stallbuy pricebuy quantitysell islandsell stallsell pricesell qty
-<% $cell %> -
+<& dumpqueryresults, sth => $sth &>