作者cot123 (cot)
看板Perl
标题Re: [请益] sql指令SOURCE 的用法
时间Tue Mar 10 02:04:00 2009
※ 引述《carrie0905 (认真的生活)》之铭言:
[恕删]
: error message如下
: DBD::mysql::st execute 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 'SOURCE qq{/home/carrie/ftpdownload/file_new/table.sqltable.sql}'
^^^ ^
: at line 1 at MirMAPs.pl line 74.
我想mysql应该不认识qq{}吧
虽然有点丑 但如果换成单引号 加上反斜线替代qq{}应该可行吧
像是
$source = "SOURCE \'/home/carrie/ftpdownload/file_new/table.sqltable.sql\'";
$dbh->prepare($source);
记得DBI好像有quote()可以用 不过我不确定合不合你的需求就是了
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.90.81
1F:推 carrie0905:谢谢你的帮忙!! 可是我改成'\之後还是出现一样的error 03/10 09:16
2F:→ carrie0905:message耶>"< 不知道是出了什麽错.... 03/10 09:17
3F:推 carrie0905:改成\' 也是不行耶 error message内容是一样 麻烦了! 03/10 11:11
4F:推 buganini:改双引号? 03/10 13:07
5F:→ iFEELing: / 应该不是特殊符号吧 把单引号也抽掉看看? 03/10 23:54
6F:推 carrie0905:嗯...不能用在双引号里再用双引号 所以才要用那个用法 03/11 10:41
7F:推 carrie0905:所以还是处在ERROR的状态.... 03/11 17:05