Welcome Guest, Not a member yet? Register   Sign In
How to insert data from exported MySQL file
#1

[eluser]caperquy[/eluser]
I would like to insert into my table, using codeigniter, the result of an export from MySQL. The data to be inserted look like :

INSERT INTO `mytable` (`field1`, `field2`, `field3`) VALUES
(1, aaa1', 'aaa2', aaa3'),
(2, bbb1', 'bbb2', bbb3'),
(3, ccc1', 'ccc2', ccc3'),
(4, ddd1', 'ddd2', ddd3');

What is the way to do it ? This may be a basic question but I have not found the way to do it. Can someone help me.
Thanks in advance.

CapErquy
#2

[eluser]Edmundas KondraĊĦovas[/eluser]
First of all, you have posted the topic in the wrong forum. This one is dedicated to contributions to CodeIgniter (libraries etc) and discussions about it. Your question is not related to that.

Now as for your question, all the basic answers are in the user guide: http://ellislab.com/codeigniter/user-gui...index.html

The simpliest way to run queries is like this:

Code:
$this->db->query('YOUR QUERY HERE');
#3

[eluser]caperquy[/eluser]
Many thanks for your reply which solve my problem.
Sorry for having choosen the wrong forum

CapErquy




Theme © iAndrew 2016 - Forum software by © MyBB