I was trying to parse a text file and then insert the data into MySQL.
The file contains a line of header records as follows:
Date|Time|First name|Last name|Notes|Result
20081210|231053|Jack|Hendreson|Special action|Pass
20090115|120925|Mary|Whitichi||Fail
So a result after parse text, I can insert the data with the something like:
INSERT INTO tablename (Date, Time, First name, Last name, Notes, Result) VALUES ('20081210', '231053', 'Jack', 'Henderson', 'Special action', 'Pass'),
('20090115', '120925', 'Mary', 'Whititchi', NULL, 'Fail')
p.s. Not sure if was using the correct SQL command. Can someone help me with the php script?
Thanks in advance.