I have semicolon-separated .dat
file and I want to read that file and store its contents into a database.
Structure of .dat
file:
This is a common task done daily by DBAs. It can be done in mysql with the LOAD command. No need to use PHP.
http://dev.mysql.com/doc/refman/5.1/en/load-data.html
LOAD DATA LOCAL INFILE 'file.dat'
INTO TABLE table_name
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n'
(PARTYID, PARTYCODE, CONNECTIONID)
IGNORE 1 LINES;