Jump to content

[SOLVED] LOAD DATA help


sasori

Recommended Posts

i have 3 tables

- customer

- order

- orderitem

 

inside customer table it has these columns

-cust_id

-fname

-lname

-street

-city

-state

-zip

-phone

-fax

-email

 

then i created a customer.txt file and has contents like

 

,freddy,kruger,elm street,angels,CA,20204,000-000-000,,[email protected],,,

,albert,einstein,geek street,carlson,MA,23251,000-000-000,,[email protected],,,

 

i placed this customer .txt file in my c:\wamp\www\webapp\    directory

 

then i tried the command in my mysql console

LOAD DATA INFILE "c\wamp\www\webapp\customer.txt" INTO TABLE "customer";

but it doesn't work at all, what should i to ?  ???

i even tried to replace the double quotation mark with back ticks

or replace the backslash into forward slash..and still it won't work.

 

Link to comment
https://forums.phpfreaks.com/topic/121069-solved-load-data-help/
Share on other sites

LOAD DATA LOCAL INFILE "c:\wamp\www\webapp\customer.txt" INTO TABLE "customer";

 

i found another way and it worked just fine :)

LOAD DATA INFILE 'c:/wamp/www/webapp/customer.txt' INTO TABLE customer
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n';

 

thanks for the help  :)

Archived

This topic is now archived and is closed to further replies.

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