OK, I have just been reading and trying for the last hour to import a csv file from access into mysql, but I can not get it to do it correctly, no matter what I try.
My table is like so:
+-----------------+-------------
| Field | Type
+-----------------+-------------
| ARTICLE_NO | varchar(20)
| ARTICLE_NAME | varchar(100)
| SUBTITLE | varchar(20)
| CURRENT_BID | varchar(20)
| START_PRICE | varchar(20)
| BID_COUNT | varchar(20)
| QUANT_TOTAL | varchar(20)
| QUANT_SOLD | varchar(20)
| STARTS | datetime
| ENDS | datetime
| ORIGIN_END | datetime
| SELLER_ID | varchar(20)
| BEST_BIDDER_ID | varchar(20)
| FINISHED | varchar(20)
| WATCH | varchar(20)
| BUYITNOW_PRICE | varchar(20)
| PIC_URL | varchar(20)
| PRIVATE_AUCTION | varchar(20)
| AUCTION_TYPE | varchar(20)
| INSERT_DATE | datetime
| UPDATE_DATE | datetime
| CAT_1_ID | varchar(20)
| CAT_2_ID | varchar(20)
| ARTICLE_DESC | varchar(20)
| DESC_TEXTONLY | varchar(20)
| COUNTRYCODE | varchar(20)
| LOCATION | varchar(20)
| CONDITIONS | varchar(20)
| REVISED | varchar(20)
| PAYPAL_ACCEPT | tinyint(4)
| PRE_TERMINATED | varchar(20)
| SHIPPING_TO | varchar(20)
| FEE_INSERTION | varchar(20)
| FEE_FINAL | varchar(20)
| FEE_LISTING | varchar(20)
| PIC_XXL | tinyint(4)
| PIC_DIASHOW | tinyint(4)
| PIC_COUNT | varchar(20)
| ITEM_SITE_ID | varchar(20)
Which should be fine, and my data is currently semicolon delimited, an example of a row from my csv file is thus:
"110268889894";"ORIGINAL 2008 ED HARDY GÜRTEL* MYSTERY LOVE * M *BLACK";"";0,00 €;0,00 €;0;1;0;8.7.2008 17:18:37;5.11.2008 16:23:37;6.10.2008 17:23:37;29;0;0;0;125,00 €;"";0;2;6.10.2008 16:21:51;6.10.2008 14:19:08;80578;0;;0;77;"";0;0;1;0;-1;0,00 €;0,00 €;0,00 €;0;0;0;77
"110293328957";"Orig. Ed Hardy Shirt - Tank Top - Gr. XS- OVP/NEU";"";25,05 €;0,00 €;7;1;0;27.9.2008 06:26:27;6.10.2008 18:26:21;6.10.2008 18:26:21;49;0;0;0;0,00 €;"";0;1;6.10.2008 16:21:56;6.10.2008 16:33:20;31058;0;;0;77;"";1;0;0;0;-1;0,00 €;0,00 €;0,00 €;0;0;0;77
I am using a simple php page to output the table data, and it is completely wrong. The problem is not with the php page as a simple table with just text displays perfectly. I am wondering if I have selected incorrect field types or the colums do not match up, but I see no reason this would be the case. Could something be happening because the data is trying to be displayed as html?
I have tried to keep this question as specific as possible, and am not asking for people to do it for me like others have suggested, but I honestly can not see where the problem is.
edit: When trying to display the data through php, at the moment the page is completely black with some tablee cells having borders and others not, othertimes when trying different delimiters, the fields do not match the columns. The starts field has never displayed correctly.
I am loading the file from a CSV file with this command:
LOAD DATA LOCAL INFILE 'C:/Dokumente und Einstellungen/hom/Desktop/tblAuction.txt' INTO TABLE Auctions FIELDS TERMINATED BY '\"' LINES TERMINATED BY '\n';
It looks fine in the DB as far as I have been able to tell, apart from the starts field, which is not the main problem at the moment.
edit2: I have serialized the result, and this is what was output to the screen:
i:0;
I have absolutely no idea what that means.
edit3: I had tried updating the terminated by delimiter, and after changing \" to ; the problem still remains of data not being put into the correct columns etc.., I don't understand what I have missed..