• 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.

    爪子下。。。下次不要犯这么弱智的错误

  • 相关阅读:
    PHP之目录遍历
    PHP之验证码
    PHP之验证码
    PHP之异常处理模式
    PHP之pdo的预处理模式
    PHP之PDO
    PHP之cookie和session
    PHP之MVC
    单例模式
    ThreadLocal
  • 原文地址:https://www.cnblogs.com/amoy9812/p/6590899.html
Copyright © 2020-2023  润新知