canadabeeau Posted January 16, 2010 Share Posted January 16, 2010 How do I go about making PHP install to a MySQL DB the content in a .sql file? Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/ Share on other sites More sharing options...
oni-kun Posted January 16, 2010 Share Posted January 16, 2010 How do I go about making PHP install to a MySQL DB the content in a .sql file? I'm not sure what you're asking from your wording, but if you're wanting to import a .sql file into a database you'd use phpMyAdmin, or via command line: mysql -p -h DBSERVER dbname < dbname.sql I can list many ways, but It'd help to further explain yourself. Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-995983 Share on other sites More sharing options...
canadabeeau Posted January 16, 2010 Author Share Posted January 16, 2010 I am building a file called install.php now it needs to get the mysql export (install.sql) and import it into the database that the user types in the details for. This is completely separate from my question about command line. Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-995984 Share on other sites More sharing options...
trq Posted January 16, 2010 Share Posted January 16, 2010 You would still execute the commands oni-kun posted via exec or similar. Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-995985 Share on other sites More sharing options...
canadabeeau Posted January 16, 2010 Author Share Posted January 16, 2010 ??? Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-995987 Share on other sites More sharing options...
trq Posted January 16, 2010 Share Posted January 16, 2010 What part don't you understand exactly? Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-995988 Share on other sites More sharing options...
canadabeeau Posted January 23, 2010 Author Share Posted January 23, 2010 I basically have a .sql file which I need to use a HTML form that I will "Browse" to it and then submit to the formsubmit.php which I then need to do as per .sql file (ie add table, or update table, etc) Quote Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-1000431 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.