--- db/prgsrc/db.cgi 2001/12/10 21:28:33 1.48 +++ db/prgsrc/db.cgi 2001/12/11 12:30:23 1.50 @@ -74,7 +74,7 @@ sub GetTournament { foreach $name (@{$sth->{NAME}}) { $Tournament{$name} = $arr[$i++]; } - + $sth->finish; return %Tournament; } @@ -95,6 +95,7 @@ sub GetQuestion { $Question{$name} = $arr[$i++]; } + $sth->finish; return %Question; } @@ -112,6 +113,7 @@ sub GetTourQuestions { push @Questions, $arr[0]; } + $sth->finish; return @Questions; } @@ -128,7 +130,7 @@ sub GetTours { while (@arr = $sth->fetchrow) { push @Tours, $arr[0]; } - + $sth->finish; return @Tours; } @@ -142,6 +144,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 +270,7 @@ print "$query",br if $printqueries; { push (@{$nf[$i]},$arr[0]) } + $sth->finish; } @@ -313,6 +317,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 +327,7 @@ print "$query\n",br if $printqueries; { $frequence[$i]+=$arr[0]; } - + $sth->finish; if (@blob < 4) @@ -529,7 +534,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 +1039,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 +1131,7 @@ sub PrintDates { " " . a({href=>url . "?tour=$Tournament{'Id'}&answer=0"}, $Tournament{'Title'}, $Tournament{'PlayedAt'})); } + $sth->finish; $output .= dl($list); return $output; } @@ -1144,6 +1151,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 +1225,7 @@ a({href=>url."?authors=surname"},"ÆÁÍÉÌÉ } } $output.=""; + $sth->finish; return $output; } @@ -1313,6 +1322,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 +1365,7 @@ $sstr=~s/[^ÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔ WHERE FileName = '$tour.txt'"); $sth->execute; $tour = ($sth->fetchrow)[0]; + $sth->finish; } print &PrintTournament($dbh, $tour, param('answer')); }