Perl插入MySQL中双引号的问题# Programming - 葵花宝典
L*r
1 楼
用如下语句给MySQL插值,当$words[0]= " 的时候,perl脚本出错:
比如这行数据: ! ) " 60252
my $rows = $dbh->do(qq{INSERT INTO GoogleDVD_all (word_0,word_1,word_2,N1)
VALUES ("$words[0]","$words[1]","$words[2]","$words[3]")});
DBD::mysql::db do failed: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to
use near '60252")' at line 1 at delimiter_changer4.pl line 15, line
31.
请赐教,谢谢
比如这行数据: ! ) " 60252
my $rows = $dbh->do(qq{INSERT INTO GoogleDVD_all (word_0,word_1,word_2,N1)
VALUES ("$words[0]","$words[1]","$words[2]","$words[3]")});
DBD::mysql::db do failed: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to
use near '60252")' at line 1 at delimiter_changer4.pl line 15,
31.
请赐教,谢谢