#1
  1. No Profile Picture

    Join Date
    Feb 2017
    Location
    Mohali, Punjab
    Posts
    2
    Rep Power
    0

    How to import .sql file using PHP


    I want a php script to import a .sql file, can anyone help me.
  2. #2
  3. Confusing Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    15,877
    Rep Power
    9569
    You can probably use mysqli::multi_query() or PDO::execute() to execute the entire file at once.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2015
    Posts
    49
    Rep Power
    2
    Good answer: what requinix said.

    Sad answer: you probably shouldn't. Backups should be restored via mysqlimport or a similar command.
  6. #4
  7. No Profile Picture

    Join Date
    Feb 2017
    Location
    Mohali, Punjab
    Posts
    2
    Rep Power
    0
    Thank you for providing me a informative information

IMN logo majestic logo threadwatch logo seochat tools logo