Hi Monkers,
I have use the DBD::Sybase one year or so. That's nice to work to connect SqlServer.
But recently, i came across a strange garbage issues. pls help me to check.
I wanna insert a Asian characters' html content into SqlServer ,
if i do it like this, it work nicely.
$some_content = 'so long Asian character (maybe it contain single quot
+ation)';
$sql = "insert into test_table(field) values ($dbh->quote($some_conten
+t))";
$dbh->do($sql); # you know, this works.
But if i do it by another way, i get some garbage character in test_table:
$some_content = $dbh->quote('so long Asia character (maybe it contain
+single quotation)');
$sth = $dbh->prepare("insert into test_table(field) values (?)");
$sth->execute($some_content);
$sth->finish();
What's wrong with the second method? Or it is a $dbh->quote bug in Asian character?
Thanks in advance!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.