version 1.38, 2004/01/10 21:07:38
|
version 1.41, 2005/12/10 00:03:55
|
Line 175 sub UpdateTournament {
|
Line 175 sub UpdateTournament {
|
|
|
sub UpdateQuestion { |
sub UpdateQuestion { |
my ($dbh, $QuestionId, $field, $value) = @_; |
my ($dbh, $QuestionId, $field, $value) = @_; |
|
|
|
if (($field eq 'Type') && ($value eq "'ä'")) { |
|
$value = "'þä'"; |
|
} |
$dbh->do("UPDATE Questions SET $field=$value |
$dbh->do("UPDATE Questions SET $field=$value |
WHERE QuestionId=$QuestionId") |
WHERE QuestionId=$QuestionId") |
or die $dbh->errstr; |
or die $dbh->errstr; |
Line 277 MAIN:
|
Line 281 MAIN:
|
|
|
my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") |
my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") |
or die "Can't connect to DB chgk\n"; |
or die "Can't connect to DB chgk\n"; |
|
$dbh->do("SET NAMES 'koi8r'"); |
my @sources; |
my @sources; |
open UNSORTED, ">$unsortedname"; |
open UNSORTED, ">$unsortedname"; |
while ($source = shift) { |
while ($source = shift) { |
Line 385 MAIN:
|
Line 390 MAIN:
|
next; |
next; |
} |
} |
|
|
if ($key =~ /÷ÉÄ/) { |
|
if ($value =~ /^\s*ä\s*$/) {#Questions ä are really þä... |
|
$value = "äþ"; |
|
} |
|
&UpdateQuestion($dbh, $QuestionId, "Type", $value); |
|
next; |
|
} |
|
|
|
|
|
|
|
my @Fields = grep { $key =~ /$_/ } keys %QuestionFields; |
my @Fields = grep { $key =~ /$_/ } keys %QuestionFields; |