Jump to content

CSV Import / Fields?


jaymc

Recommended Posts

I have made a script in php that will read a CSV file and with that it will create a new table in  mysql using the fields and data provided in the csv file.

 

The issue I have is a file I used for testing contains 80 fields. At the moment I am just setting every field to varchar(700) regardless just to be on the safe side.

 

However, mysql is complaining about 65000 limit on varchar combined. This also is not a good way as some fields may require more than 700 chars

 

Whats the best way I can safely a csv field and data structure into mysql via code without having a buggy system which may fail if the data/fields in the csv file does not gel with my code...

Link to comment
https://forums.phpfreaks.com/topic/159681-csv-import-fields/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.