This post was first published on How To Import SQL File With PHP
Sometimes there are times when you can not use PhpMyAdmin or any database program...
For further actions, you may consider blocking this person and/or reporting abuse
mysql_
functions are deprecated and they have been removed at some point iirc. UsePDO
and if your hosting does not support that, you should change the hosting.That's right! Thanks for reminding.
Could you just use the mysql command like this?
Yes, you can do that way and it's better and simpler but I wrote this article for who uses shared hosting or free hosting.
You even can't know when you need this. You may need this to help a friend or to do a client's job at a time you've never thought of.
Ah yeah, I hadn't thought of that. Nice article anyway!
Thanks! :)
Or you can simply $conn->multi_query(file_get_contents('db.sql'))
worked flawless with PDO 👍