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? 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. 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. 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. 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 ??? 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? 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) Link to comment https://forums.phpfreaks.com/topic/188657-php-to-install-db/#findComment-1000431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.