Forum Moderators: coopster

Message Too Old, No Replies

Insert list of column values into MySQL from textfile

list of email addresses which I would like to insert into a MySQL table

         

s9901470

7:38 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Hi

I have a list of email addresses which I would like to insert into a MySQL (version 2.6.0) table which has the fields id, username, pw, email, lastupdated.

Is there a way to adapt the following code to insert all of them at once? I basically want to ignore id, username, pw, lastupdated.

INSERT INTO mail(email) VALUES ('bob@bob.com');
INSERT INTO mail(email) VALUES ('geoff@geoff.com');

Any suggestions most welcome.

vincevincevince

7:40 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



INSERT INTO mail (email) VALUES ('email@example.foo'),('test@example.foo'),....

I believe.

s9901470

8:10 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



that works great, many thanks