I have a batch of CSV files that I download several times a day and would like to have them turned into MySQL tables. The first line of the CSV is headings and there could be as many as a couple hundred headings and 20,000 lines.
I would like the script to read the headings then decide what type of data is under each heading (varchar, int, dec, text…) and build the sql statement to create the table.
A PHP function would be great. Something that simply takes the name of the CSV file and the name I want the MySQL table to have. I'm thinking this is a quick and easy project. I have included a sample of a CSV. Again, there are several and each have different headings. The script needs to build the sql based on the headings in each CSV, but I can write the code that walks through the different files. I just need the function to do the work.
Questions? Please feel free to ask.
Décerné à :
27 freelance font une offre moyenne de $135 pour ce travail