trying to use "LOAD DATA LOCAL INFILE " to import
Posted: Fri Nov 10, 2006 5:09 pm
feyd | Please use
start of csv file[/syntax]
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
trying to import data using a query, trying to use MySQL Query Browser but cant seem to work out where on the server to put the csv file... iv tired uploading it to public_html and also the main directory... would it be best to do a php page and put the csv file in the same directory or something like that? or is there a better function to use?
thanks
clint
[syntax="sql"]LOAD DATA LOCAL INFILE '/newprice.csv'
INTO TABLE `newprice list`
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'start of csv file[/syntax]
Code: Select all
PartNumber,Description,CategoyName,CategoryID,ExTax,IncTax
ADDBT-122,DLINK DBT-122 BLUETOOTH USB ADAPTER,ACCESSORIES,2500,55,60.5
ADDBT-GTE-410,BESTA USB BLUETOOTH DONGLE (100M),ACCESSORIES,2500,39,42.9
ADUP,USB TO PS/2 ADAPTOR,ACCESSORIES,2500,3,3.3
BCASECD,CD / DVD CASE - CARRIES 2 DVD OR CD,BLANK MEDIA,3200,0.4,0.44
BCASEDVD,"DVD CASE - CARRIES 1 DVD (7mm, BLACK)",BLANK MEDIA,3200,0.25,0.28
BCASEDVDS,"DVD CASE - CARRIES 1 DVD (14mm, BLACK)",BLANK MEDIA,3200,0.4,0.44
BCASEDVDSL,DVD/CD SLEEVES (100 PCS),BLANK MEDIA,3200,3,3.3
BCDAT(50),ATERRA 50 PCS CD-R 80MIN 40x BLANK CD,BLANK MEDIA,3200,20,22
BCDB50,BENQ GOLD CD-R 50PCS SPINDLE,BLANK MEDIA,3200,13,14.3
BCDBRW32,BENQ 32x CDRW (10 PCS SLIMELINE CASE),BLANK MEDIA,3200,12,13.2
BCDLP,"LASER CDR 52X 80min/700MB (50PCS, PRINTABLE)",BLANK MEDIA,3200,15,16.5
BCDM10,MITSUBISHI 700MB 48x CD-R (10PCS JEWEL CASE),BLANK MEDIA,3200,7,7.7
BDVDA10-,ACCESS DVD-R 16X MEDIA (10PCS SPINDLE),BLANK MEDIA,3200,3.5,3.85
BDVDA50-,ACCESS DVD-R 16X MEDIA (50PCS) PRINTABLE,BLANK MEDIA,3200,18,19.8feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]