From da8db80459e25a474b545779db3fcd0304e68325 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 22 Aug 2009 13:35:28 +0100 Subject: [PATCH] New dumpqueryresults component for handy debugging etc. --- yarrg/web/dumpqueryresults | 20 ++++++++++++++++++++ yarrg/web/profitable_trades | 14 +------------- 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 yarrg/web/dumpqueryresults 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 &> -- 2.30.2