Jump to content

load complete dump into database with one query


mstenbaek

Recommended Posts

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 !

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.