Page 1 of 1

[SOLVED] Inserting data into a table

Posted: Mon Jun 09, 2008 3:25 pm
by texmansru47
Is there a clean why to insert data from a CSV file into a pre-existing MySQL table? I have tried the following:

Code: Select all

LOAD DATA LOCAL INFILE 'usr/testdata/importfile.csv' 
INTO TABLE testtest 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\r' 
(ProdNum, QtyOnHand, Comment); 
 
What I received was data from that process was 57 lines of blanks... imagine my surprise. Is there a better way? I tried it with my phpmyadmin to no avail as well.

Texman

Re: Inserting data into a table

Posted: Mon Jun 09, 2008 3:50 pm
by texmansru47
Nevermind... I got it.