/[webpac]/trunk/index_DBI_cache.pm
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 /trunk/index_DBI_cache.pm

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

revision 140 by dpavlin, Thu Oct 30 00:10:09 2003 UTC revision 142 by dpavlin, Thu Oct 30 01:02:22 2003 UTC
# Line 120  sub count { Line 120  sub count {
120    
121          my ($total) = $sth->fetchrow_array();          my ($total) = $sth->fetchrow_array();
122    
123          return $total;          # no results, count all
124            if (! $total) {
125                    my $sql = "select count(*) from $field";
126    
127                    my $sth = $self->{dbh}->prepare($sql) || die $self->{dbh}->errstr();
128                    $sth->execute() || die "sql: $sql; ".$self->{dbh}->errstr();
129                    $total = $sth->fetchrow_array();
130    
131            }
132    
133            return $total || 1;
134  }  }
135    
136    

Legend:
Removed from v.140  
changed lines
  Added in v.142

  ViewVC Help
Powered by ViewVC 1.1.26