50 |
return @data; |
return @data; |
51 |
} |
} |
52 |
|
|
53 |
|
sub sql_html { |
54 |
|
my @d = @_; |
55 |
|
my $sql_html = shift @d; |
56 |
|
$sql_html =~ s{\?}{dump( shift @d )}ge; |
57 |
|
return $sql_html; |
58 |
|
} |
59 |
|
|
60 |
if ( my $group_by = param('lookup_col') ) { |
if ( my $group_by = param('lookup_col') ) { |
61 |
|
|
62 |
my @cols = ( $group_by, "count($group_by)" ); |
my @cols = ( $group_by, "count($group_by)" ); |
93 |
my $sth = $dbh->prepare( $sql ); |
my $sth = $dbh->prepare( $sql ); |
94 |
$sth->execute( @data ); |
$sth->execute( @data ); |
95 |
$t = time() - $t; |
$t = time() - $t; |
96 |
print qq|<code>$sql<code>|; |
print qq|<code>|, sql_html( $sql, @data ), qq|<code>|; |
97 |
print qq|<table><tr><th>|, join(qq|</th><th>|, @cols), qq|</th></tr>|; |
print qq|<table><tr><th>|, join(qq|</th><th>|, @cols), qq|</th></tr>|; |
98 |
while ( my @row = $sth->fetchrow_array ) { |
while ( my @row = $sth->fetchrow_array ) { |
99 |
my $n = shift @row; |
my $n = shift @row; |
144 |
|
|
145 |
push @data, ( $limit, $offset ); |
push @data, ( $limit, $offset ); |
146 |
|
|
147 |
my $sql_html = $sql; |
print qq|<code id="status">|, sql_html( $sql, @data ), qq|<br>\n|; |
|
{ |
|
|
my @d = @data; |
|
|
$sql_html =~ s{\?}{dump( shift @d )}ge; |
|
|
} |
|
|
print qq|<code id="status">$sql_html<br>\n\r\n\r|; |
|
148 |
|
|
149 |
my $t = time(); |
my $t = time(); |
150 |
|
|