Parent Directory | Revision Log | Patch
revision 141 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 |
|
ViewVC Help | |
Powered by ViewVC 1.1.26 |