作者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