Alright, I've got this exported text file, comma delimited, records ending with newline (saved in notepad) and all the fields in quotes (though I can remove those) The few first records look like this:
"0","NA","NA","NA","10","NA","0","0","0","NA","NA","NA"
"857","Stools","Public","wood 5","10","Normal Furnishings","0","0","0","a rickety wooden stool","A rickety wooden stool stands here, awaiting a weary traveller.","Lacking polish or lustre, this aged wooden stool is pieced together from four gold hued legs; upon which a top of darker grained wood has been hammered. Knotted in many places, the quality of wood used in this construction is seemingly of very poor quality. The seat is split in several places, ensuring whoever is sitting atop will find little to no comfort."
"912","Baskets","Public","wood 2 rope 3","0","NA","0","1","0","a wicker basket","A finely woven wicker basket rests here.","Crafted from hundreds of small strands of darkly polished wicker, this ornate basket is both a testament of strength and fragility. A graceful handle of the same braided material arches from one side to the other, providing just enough give for the comfort of the carrier. The lid is adorned with dried flowers and leafy vines, adding yet another touch of elegance to this basket."
That first entry is just a dummy entry, obviously. I've already got the fields in the MySQL database set up, and I'm trying to import it all. Right now I'm just going straight from the phpmyadmin panel, but I'd like to have a script where I can browse and find the file and do it that way, but getting it to work either way would be helpful. Here's my mysql statment:
LOAD DATA LOCAL INFILE 'C:\zMUD\dbfile.csv'
INTO table artisan
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
But I get an error. It says my sql statement is just the entire file, without any mysql commands, and says:#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"0","NA","NA","NA","10","NA","0","0","0","NA","NA","NA"
"857",
I really, really want to figure this out. If you can put it into php instead of the straight mysql statement, even better, but if someone could just help make it simply work, I'd be most grateful.
Thanks