0

I have mysql table called 'master'

CREATE TABLE `master` ( `id` int(7) NOT NULL AUTO_INCREMENT, `destination` varchar(30) NOT NULL, `bay` varchar(5) DEFAULT NULL, `shipInvoiceNumber` varchar(20) NOT NULL, `invoiceNumber` varchar(20) DEFAULT NULL, `start` varchar(20) NOT NULL, `end` varchar(20) NOT NULL, KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=100113 DEFAULT CHARSET=latin1; 

i have write a code using LOAD DATA INFILE.

mysql_query("LOAD DATA INFILE 'master.csv' INTO TABLE master fields terminated by ',' (destination,bay,shipInvoiceNumber,invoiceNumber,start,end);"); 

my 'master.csv' file

KANDY,Bay1,2011/331,5618,60842,60855
KANDY,Bay1,2011/331,5618,62493,62493

but it didnt import data in to database table.

any issue?

3
  • 1
    What happened instead? Did you get error messages? Where did you run the query from? Commented Aug 21, 2011 at 7:18
  • no error message. but not insertion to table. Commented Aug 21, 2011 at 13:55
  • Where did you run the query from? phpMyAdmin? Commented Aug 21, 2011 at 19:03

1 Answer 1

1

It can be two causes without additional info about error:

  1. Mysql is remote server and you try to load file from remote server. So you use LOAD DATA LOCAL INFILE. See section with LOCAL description in http://dev.mysql.com/doc/refman/5.1/en/load-data.html
  2. You haven't got permissions to run this command
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.