/[sql-web-session]/index.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /index.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 26 by dpavlin, Sat Apr 18 23:54:30 2009 UTC revision 27 by dpavlin, Sat Apr 18 23:58:42 2009 UTC
# Line 50  sub where_from_parts { Line 50  sub where_from_parts {
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)" );
# Line 86  if ( my $group_by = param('lookup_col') Line 93  if ( my $group_by = param('lookup_col')
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;
# Line 137  $sql .= ' limit ? offset ?'; Line 144  $sql .= ' limit ? offset ?';
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    

Legend:
Removed from v.26  
changed lines
  Added in v.27

  ViewVC Help
Powered by ViewVC 1.1.26