Home > Backend Development > PHP Tutorial > The source command cannot be used?

The source command cannot be used?

WBOY
Release: 2016-10-19 10:18:52
Original
971 people have browsed it

Can’t import? ? ?

<code>You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'source D:\Server\three\public\export.sql' at line 1</code>
Copy after login
<code class="php">
function ImportDB($dbh) {
  $sql = 'source '.realpath('export.sql');
  try {
    $stmt = $dbh->prepare($sql);
    var_dump($stmt->execute());
    var_dump($stmt->errorInfo());
  }
  catch (PDOException $e) {
    print $e->getMessage();
  }
}
</code>
Copy after login

Note: There is no problem importing the package:

The source command cannot be used?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template