I'm having trouble while creating the database automatically via PHP. I am developing a project in MVC from college and wanted to import the sql file and through a query create the tables.
In the previous part of the code is made the connection with the database and also the creation of the database also via query and both work perfectly; but at the time of creating the tables nothing happens nor errors, the code is as follows:
$sql = file_get_contents(BASE_URL."database/arquivo.sql");
echo $sql;
$this->connection->multi_query($sql);
I have tried with query()
and multi_query()
and nothing happens, what could be wrong?
Well, the sql file link is this: link
is indicating the following error:
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 'SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_' at line 12
If I delete this line, the error continues to the following lines, I can not resolve.