--- db/prgsrc/updatedb.pl 2000/10/22 23:47:06 1.16 +++ db/prgsrc/updatedb.pl 2000/11/11 00:30:06 1.17 @@ -22,7 +22,7 @@ The database, user and password are hard Dmitry Rubinstein -=head1 $Id: updatedb.pl,v 1.16 2000/10/22 23:47:06 boris Exp $ +=head1 $Id: updatedb.pl,v 1.17 2000/11/11 00:30:06 boris Exp $ =cut @@ -199,10 +199,10 @@ sub GetTours { } sub CreateTour { - my ($dbh,$title,$ParentId,$rh_defaults)=@_; + my ($dbh,$title,$ParentId,$TourNum,$rh_defaults)=@_; my $sth = $dbh->prepare("INSERT INTO Tournaments - (Title, Type, ParentId) - VALUES ($title, 'ô', $ParentId)"); + (Title, Type, ParentId, TourNum) + VALUES ($title, 'ô', $ParentId, $TourNum)"); $sth->execute; my $TourId = $sth->{mysql_insertid}; while (my ($key,$value)=each %$rh_defaults) { @@ -237,6 +237,7 @@ MAIN: or die "Can't connect to DB chgk\n"; while ($source = shift) { + my $TourNum=0; my($PlayedAt) = ''; my($QuestionId, $TourId, $TournamentId, $ParentId) = (0, 0, 0, 0); my($tournum, $qnum, $all_qnum) = (0, 0, 0); @@ -281,7 +282,9 @@ MAIN: WHERE Id=$TourId"); } $qnum = 0; - $TourId=CreateTour($dbh,$value,$TournamentId,\%TourDefaults); + $TourNum++; + $TourId=CreateTour($dbh,$value,$TournamentId,$TourNum, + \%TourDefaults); %QuestionDefaults=%QuestionGlobalDefaults; $QuestionId=0; next;