mstenbaek Posted February 3, 2009 Share Posted February 3, 2009 Hi Is it possible to load a complete database dump into mySql like phpMyAdmin can (through the ”sql query field”) This is a small part of what I would like to load into my database through my own php code (my users can't have access to phpMyAdmin) : drop table if exists bruger; create table bruger ( brugerId int auto_increment primary key, navn char(100), email char(200), kode char(30), adm char(1), loginCount int ); insert into bruger (brugerId, navn, email, kode, adm, loginCount) values (1, "Bruger_1", "mail@Bruger_1.dk", "XXXXXXX", "", 48); insert into bruger (brugerId, navn, email, kode, adm, loginCount) values (2, "Bruger_2", "mail@Bruger_2.dk", "XXXXXXX", "1", 30); I have tried $backup = include("../backup/".$dbFil); $result = mysql_query($backup); without any luck. Thanks in advance ! Quote Link to comment https://forums.phpfreaks.com/topic/143596-load-complete-dump-into-database-with-one-query/ Share on other sites More sharing options...
fenway Posted February 6, 2009 Share Posted February 6, 2009 You need to use LOAD DATA INFILE. Quote Link to comment https://forums.phpfreaks.com/topic/143596-load-complete-dump-into-database-with-one-query/#findComment-755789 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.