[SOLVED] Inserting data into a table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
texmansru47
Forum Commoner
Posts: 42
Joined: Mon May 12, 2008 11:27 am

[SOLVED] Inserting data into a table

Post 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
Last edited by texmansru47 on Tue Jun 10, 2008 7:58 pm, edited 1 time in total.
texmansru47
Forum Commoner
Posts: 42
Joined: Mon May 12, 2008 11:27 am

Re: Inserting data into a table

Post by texmansru47 »

Nevermind... I got it.
Post Reply