LOAD DATA INFILE help
| From: | Tyler Longren | Date: | Sat, 01 Dec 2001 18:19:09 +0000 |
| Subject: | LOAD DATA INFILE help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76319@lists.php.net to get a copy of this message | ||
Hello everyone,
I posted this message to the mysql mailing list and didn't get a response.
I know a lot of people here are good with SQL. So, here's my e-mail:
Hello,
I've been struggling with this all night. Can someone give me a push in the
right direction? I
have a csv file named Sheet1.txt, here's an example of its contents:
"P1002565",
"P1002566",
"P1002638",
I want to put the contents of Sheet1.txt in a table named 'passcodes'. The
passcodes table has 2 fields: 'id' and 'passcode'. I run this:
LOAD DATA INFILE 'Sheet1.txt' INTO TABLE passcodes FIELDS TERMINATED BY ','
ENCLOSED BY '"' LINES TERMINATED BY '\n';
Nothing gets inserted into the 'passcode' field, but ID's are generated for
every item in Sheet1.txt.
Can anyone give me some help? Sorry for the sort of off-topic question!
Thanks,
Tyler Longren