Answer the question
In order to leave comments, you need to log in
How to defeat krakozyabry when inserting into a PERL database?
I get text from the database for processing in koi8r format
my $sql= 'SELECT NAMB FROM spr_banks WHERE bik='.$bik.' AND off = 0 LIMIT 1';
my $sth= $dbh->prepare($sql) or error('CANNOT_PREPARE', 'Не могу подготовить запрос '.(DEBUG ? $sql.':<br> '.$DBI::errstr : ''));
$sth->execute or error('CANNOT_EXECUTE', 'Не могу выполнить запрос '.(DEBUG ? $sql.':<br> '.$DBI::errstr : ''));
my $res= $sth->fetchrow_arrayref;
my $name_bank= $res->[0];
foreach my $m (@money_id){
$sql="UPDATE arm_money SET number_bank_acc='$number_bank_account', name_bank='$name_bank',
related_pay_info='$related_pay_info' WHERE LinkID= ".$m;
$sth= $dbh->prepare($sql) or error('CANNOT_PREPARE', 'Не могу подготовить запрос '.(DEBUG ? $sql.':<br>
'.$DBI::errstr : ''));
$sth->execute() or error('CANNOT_EXECUTE', 'Не могу выполнить запрос '.(DEBUG ? $sql.':<br> '.$DBI::errstr : ''));
}
Answer the question
In order to leave comments, you need to log in
Isn't it easier to set the encoding to utf8 in the database settings?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question