stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / search / sql.html
index 71aa006..54d6c2d 100644 (file)
@@ -2,7 +2,7 @@
                'title' => 'Query Results',
                'name'  => 'rows',
                'query' => "SELECT $sql",
-          
+               'count_query' => $count,          
 &>
 <%init>
 
@@ -12,4 +12,7 @@ die "access denied"
 my $sql = $cgi->param('sql') or errorpage('Empty query');
 $sql =~ s/;+\s*$//; #remove trailing ;
 
+my $count = $sql;
+$count =~ s/.* FROM /SELECT COUNT(*) FROM /i;
+
 </%init>