Jump to content

Recommended Posts

I am trying to dump a list of email addresses into a mysql database called mail. The list is formatted like the following:

 

email1@domain.com

email2@domain.com

 

How would I go about dumping this data to a \'sub_mail\' table with each email address auto incremented in the id field. Also I want the email field to hold the value of the emails and a field for header with a value of \'h\'?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/493-mysql-dump-data-to/
Share on other sites

One thing u can do is

 

create a css (comma seprated value) file

 

which will conatain

 

email,header

 

and try this command

 

LOAD DATA INFILE [b]file_name[/b] INTO TABLE [b]TABLE_NAME[/b]  FIELDS TERMINATED BY \',\' LINES TERMINATED BY \'n\' 

Link to comment
https://forums.phpfreaks.com/topic/493-mysql-dump-data-to/#findComment-1668
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.