I would like to preface my post by saying what we are talking about is extraordinarily dangerous. If you don't have security airtight and if the server on which you can do this is exposed to hostile entities, you could find yourself in a world of hurt.
That said....
I would first have a script upload the file. See the PHP online manual chapter titled "Handling file uploads".
Then I would take the SQL script and pass it to the mysql command-line app by using PHP's Program execution functions.
Alternatively, you could write a PHP script to parse the SQL script query-by-query and execute each query in turn, but I figure why make yourself crazy?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.