--- db/prgsrc/eq/Attic/dbchgk.pm 2001/05/18 01:37:51 1.1 +++ db/prgsrc/eq/Attic/dbchgk.pm 2001/05/18 02:14:01 1.4 @@ -1,7 +1,7 @@ package dbchgk; use DBI; use Exporter; -use VARS qw(@ISA @EXPORT); +use vars qw(@ISA @EXPORT); @ISA=qw(Exporter); @EXPORT = qw(&getbase &closebase &getrow $z &in2out &getall &out2in &mydo @@ -10,7 +10,7 @@ use VARS qw(@ISA @EXPORT); my $z; my $qbase; BEGIN {do "chgk.cnf"; - $qbase = DBI -> connect ("DBI:mysql:$base",undef,undef); + $qbase = DBI -> connect ("DBI:mysql:$base",'piataev',''); }; @@ -18,7 +18,7 @@ BEGIN {do "chgk.cnf"; sub getbase { my $a=join(", ",@_); - $z= $qbase -> prepare("select $a FROM questions WHERE QuestionId<=$qnumber"); + $z= $qbase -> prepare("select $a FROM Questions WHERE QuestionId<=$qnumber"); $z -> execute; } @@ -26,7 +26,7 @@ sub getbase sub getquestion { my $a=shift; - $z= $qbase -> prepare("select Question, Answer, Comments FROM questions WHERE QuestionId=$a"); + $z= $qbase -> prepare("select Question, Answer, Comments FROM Questions WHERE QuestionId=$a"); $z -> execute; $z -> fetchrow; } @@ -73,14 +73,14 @@ sub in2out $z= $qbase -> prepare ( "select t2.Id, t2.Number, t3.FileName - from questions AS t1, tournaments AS t2 , tournaments AS t3 + from Questions AS t1, tournaments AS t2 , tournaments AS t3 where (t1.QuestionId = $qid) && (t1.ParentId = t2.Id) && (t2.ParentId = t3.Id) "); $z -> execute; ($tourid, $tourname, $filename)= $z -> fetchrow; - $z= $qbase -> prepare("select QuestionId from questions WHERE ParentId = $tourid"); + $z= $qbase -> prepare("select QuestionId from Questions WHERE ParentId = $tourid"); $z -> execute; my $i; @@ -102,7 +102,7 @@ sub out2in # - $z= $qbase -> prepare ( "select q.QuestionId from questions as q, + $z= $qbase -> prepare ( "select q.QuestionId from Questions as q, tournaments as t1, tournaments as t2 where (t2.FileName= \"$q[0]\") && (t1.ParentId = t2.Id) &&