Welcome to WebmasterWorld Guest from 220.127.116.11
In general, what is available for moving files to mySQL from text, tab delimited, Excel, Access, dbf, etc.?
joined:Apr 27, 2003
You might want to check out PHPmyAdmin. It's a web interface for managing databases and has an import screen that makes it all too easy: [phpmyadmin.net...]
The PRODUCT_DESC has been a problem because it contains quotes and html.
I do have access to phpMyAdmin and use it frequently. I know how to create a table and insert the fields. I just need help understanding how to import from the products.dat file. It appears to be tab delimited with each row ending with a line break.
Does this help?
LOAD DATA INFILE 'c:/blah/blah.txt' INTO TABLE xyz IGNORE 1 LINES
Worked a treat
(should say that was for tab delimited though, so in excel I just changed it from csv to tab delimited - saved messing about!)
I'm glad you demonstrated the LOAD FILE syntax. I had looked at it before, but didn't know how to write the syntax.
When I try to use LOAD DATA INFIELD in phpMyAdmin I get an access denied for user 'me@localhost'.
Once again, I'm stumped.
On your other question re using LOAD in a php file, thats exactly what I did - it was basically a php sql query analyser, works fine.
OPTIONALLY ENCLOSED BY '"'
worked for me. If it doesn't and you just want to get rid of the added quotes, you do a str_replace and turn \t" and "\t, and /n" and "/n into just \t, that way the only quotes left are the ones within fields.
Hope this makes sense.
I second what bonanza wrote, with phpmyadmin this is "too easy"!