Entry
How to programmatically (PHP) import a delimited text file into a MySQL database?
Nov 21st, 2008 23:07
haytham ali, dman, Chad Currie, Hank Castello, http://sturly.com
There are a number of ways to import a delimited text file into a
mysql database.
If you upload your comma (or otherwise) delimited file to your server,
you can use something similar to the following to import the data.
LOAD DATA LOCAL INFILE '/importfile.csv'
INTO TABLE test_table
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(field1, filed2, field3);
Another option is to use php to open your file, split each line of
your file into an array, then loop through the array and use INSERT to
import the contents of your file into a mysql table.
http://6rb.com
http://fr7.com
http://dir.msryat.org
http://6ef.com
http://forums.msryat.org
http://www.arabcar.com