--- db/prgsrc/updatedb.pl 2000/10/17 01:50:39 1.1 +++ db/prgsrc/updatedb.pl 2000/10/17 02:24:47 1.3 @@ -22,7 +22,7 @@ The database, user and password are hard Dmitry Rubinstein -=head1 $Id: updatedb.pl,v 1.1 2000/10/17 01:50:39 boris Exp $ +=head1 $Id: updatedb.pl,v 1.3 2000/10/17 02:24:47 boris Exp $ =cut @@ -35,6 +35,10 @@ my (%RevMonths) = 'ïËÔ', '9', 'îÏÑ', '19', 'äÅË', '11'); my ($sth); +use vars qw($/); + +$/=/\n */; + use DBI; use strict; @@ -162,7 +166,7 @@ MAIN: VALUES ($value, 'þ', $ParentId, $source, $CreatedAt)"); $sth->execute; - $TournamentId = $sth->{insertid}; + $TournamentId = $sth->{mysql_insertid}; next; } if ($key =~ /ôÕÒ/) { @@ -171,12 +175,12 @@ MAIN: WHERE Id=$TourId"); } $qnum = 0; - $qtype = "'þ'"; + $qtype = "þ"; $sth = $dbh->prepare("INSERT INTO Tournaments (Title, Type, ParentId, CreatedAt) VALUES ($value, 'ô', $TournamentId, $CreatedAt)"); $sth->execute; - $TourId = $sth->{insertid}; + $TourId = $sth->{mysql_insertid}; next; } if ($key =~ /÷ÉÄ/) { @@ -187,8 +191,8 @@ MAIN: $sth = $dbh->prepare("INSERT INTO Questions (ParentId, Number, Type) VALUES ($TourId, $qnum+1, $qtype)"); - $sth->execute; - $QuestionId = $sth->{insertid}; + $sth->execute or print "Problem at $qnum"; + $QuestionId = $sth->{mysql_insertid}; &UpdateQuestion($dbh, $QuestionId, "Question", $value); $qnum++; $all_qnum++;