Answer the question
In order to leave comments, you need to log in
Receiving mail, parsing an attachment - a CSV file and adding data to the database in PHP. What is the fastest way to do everything?
There is a task to regularly check the mailbox to which reports are sent in CSV format and parse the data into the database. How to make it easier? It is possible to manage only IMAP? Are there lightweight CSV parsing libraries?
Answer the question
In order to leave comments, you need to log in
I found an excellent series of materials just on this issue: www.electrictoolbox.com/parsing-google-analytics-data-with-php/
In PEAR, there are no ready-made parsers: both work with mail, and a parser of everything, and work with a database with the necessary abstraction. If you don't mind of course ;-)
> Are there lightweight CSV parsing libraries?
en.php.net/manual/en/function.fgetcsv.php
MySQL can automatically load CSV files into the database
LOAD DATA INFILE
dev.mysql.com/doc/refman/5.1/en/load-data.html
(didn't use it in practice, check it out)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question