CSV TO MYSQL
| From: | Rupert | Date: | Tue, 28 Aug 2001 02:58:34 +0000 |
| Subject: | CSV TO MYSQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-11868@lists.php.net to get a copy of this message | ||
Ok, this is my issue - hope someone can help. Suppose I also need to get
this out of the way too - I am a Newbie (god..I hate that word...but it's
true.....grin!)
Anyway, I have a list of email address that I want to dump into a database
called (news) - eg.
me@my.com
this@that.com
let@this.com
there@here.com
etc..
I separated them with (;'s) like so - me@my.com; this@that.com;
let@this.com; there@here.com; etc..
(I suppose I could use commas instead - no prob there)
This is what I want to accomplish:
Each email address is a separate entry that needs to be downloaded into the
database.
Just like this:
# --------------------------------------------------------
#
# Table structure for table 'news'
#
CREATE TABLE news (
email char(255) NOT NULL,
PRIMARY KEY (email),
UNIQUE email (email)
);
#
# Dumping data for table 'news'
#
INSERT INTO news VALUES ( 'me@my.com');
INSERT INTO news VALUES ( 'this@that.com');
INSERT INTO news VALUES ( 'let@this.com');
INSERT INTO news VALUES ( 'there@here.com');
INSERT INTO news VALUES ( 'etc..');
------------------------------------------------------------
I have a script that gets me to this point:
INSERT INTO news VALUES (,"me@my.com"," this@that.com","
let@this.com","there@here.com","etc..");
But that is not what I want. I can attach the script for analysis or if
anyone has a better idea. I would appreciated it very
much. Thanks..
Rupert