--- db/prgsrc/db.cgi 2001/12/10 21:28:33 1.48 +++ db/prgsrc/db.cgi 2001/12/11 12:19:31 1.49 @@ -70,6 +70,7 @@ sub GetTournament { $sth->execute; @arr = $sth->fetchrow; + $sth->finish; my($i, $name) = 0; foreach $name (@{$sth->{NAME}}) { $Tournament{$name} = $arr[$i++]; @@ -95,6 +96,7 @@ sub GetQuestion { $Question{$name} = $arr[$i++]; } + $sth->finish; return %Question; } @@ -112,6 +114,7 @@ sub GetTourQuestions { push @Questions, $arr[0]; } + $sth->finish; return @Questions; } @@ -128,7 +131,7 @@ sub GetTours { while (@arr = $sth->fetchrow) { push @Tours, $arr[0]; } - + $sth->finish; return @Tours; } @@ -142,6 +145,7 @@ print "timeb=".time.br if $debug; $sth->execute; my @a=$sth->fetchrow; print "timee0=".time.br if $debug; + $sth->finish; $a[0]||0; } @@ -267,6 +271,7 @@ print "$query",br if $printqueries; { push (@{$nf[$i]},$arr[0]) } + $sth->finish; } @@ -313,6 +318,7 @@ print STDERR "!$query\n",br if $printque { @blob=(@blob,unpack 'C*',$arr[0]); } + $sth->finish; $query="select number from nf where ".(join ' OR ', @arr1); print "$query\n",br if $printqueries; $sth=$dbh -> prepare($query); @@ -322,7 +328,7 @@ print "$query\n",br if $printqueries; { $frequence[$i]+=$arr[0]; } - + $sth->finish; if (@blob < 4) @@ -529,7 +535,7 @@ print $query if $printqueries; while (@arr = $sth->fetchrow) { push @Questions, $arr[0] unless $forbidden{$arr[0]}; } - + $sth->finish; print "@Questions" if $printqueries; return @Questions; } @@ -1034,6 +1040,7 @@ sub Get12Random { $sth->execute; $t = ($sth->fetchrow)[0]; } until !$chosen{$q} && $t && $type =~ /[$t]/; + $sth->finish; $chosen{$q} = 'y'; push @questions, $q; } @@ -1125,6 +1132,7 @@ sub PrintDates { " " . a({href=>url . "?tour=$Tournament{'Id'}&answer=0"}, $Tournament{'Title'}, $Tournament{'PlayedAt'})); } + $sth->finish; $output .= dl($list); return $output; } @@ -1144,6 +1152,7 @@ sub PrintQOfAuthor my @Questions; while (($q)=$sth->fetchrow,$q) {push @Questions,$q unless $forbidden{$q}} + $sth->finish; my ($output, $i, $suffix, $hits) = ('', 0, '', $#Questions + 1); @@ -1217,6 +1226,7 @@ a({href=>url."?authors=surname"},"ÆÁÍÉÌÉ } } $output.=""; + $sth->finish; return $output; } @@ -1313,6 +1323,7 @@ print $query if $printqueries; my $sth=$dbh->prepare($query); $sth->execute; my $sstr= join ' ',$sth->fetchrow; + $sth->finish; $searchin{'Question'}=1; $searchin{'Answer'}=1; $sstr=~tr/£³/Åå/; @@ -1355,6 +1366,7 @@ $sstr=~s/[^ÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔ WHERE FileName = '$tour.txt'"); $sth->execute; $tour = ($sth->fetchrow)[0]; + $sth->finish; } print &PrintTournament($dbh, $tour, param('answer')); }