首页 > 代码库 > mysql api 不支持source命令
mysql api 不支持source命令
今天写了个代码
<?php
.....
mysql_query("source /tmp/cr.sql",$link);
.....
?>
结果死活cr.sql的SQL语句就是没效果,查了下,
SOURCE is definitely a command that is preprocessed by the mysql client. The server does not understand that command. So you can‘t execute SOURCE on the server using the query API.
If you can restrict the content of your SQL script to exclude mysql client builtin commands, it might work to use mysqli::multi_query(). But it won‘t work for the full set of commands that are allowed in an SQL script.
爪子下。。。下次不要犯这么弱智的错误
mysql api 不支持source命令
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。