+ # no results, count all
+ if (! $total) {
+ my $sql = "select count(*) from $field";
+
+ my $sth = $self->{dbh}->prepare($sql) || die $self->{dbh}->errstr();
+ $sth->execute() || die "sql: $sql; ".$self->{dbh}->errstr();
+ $total = $sth->fetchrow_array();
+
+ }
+
+ return $total || 1;