1,the original data is stored in the database as the image shows. the table is products.
2011-11-04_104123.jpg
2, the data in excel is as the following shows.
2011-11-04_094623.jpg
3,but when i open it by notepad++. it shows like this:
2011-11-04_094902.jpg
one: the data's format which i prepared is right? if not? how to correct it?
two: how to use joined update?
three: i using this command in phpmyadmin, supposed the csv file named test.csv. but the data doesn't be updated.
Code:
LOAD DATA LOCAL INFILE 'D:\\test.csv' REPLACE INTO TABLE products
FIELDS TERMINATED BY ' '
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(products_model, @var1)
SET products_price = IF(@var1 = '', 0, @var1); -- Replace empty string with 0
the command can run, but the data doesn't be updated. thank you.
Bookmarks