jaymc Posted May 26, 2009 Share Posted May 26, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/159681-csv-import-fields/ Share on other sites More sharing options...
trq Posted May 26, 2009 Share Posted May 26, 2009 Is there a reason you need to use csv? Quote Link to comment https://forums.phpfreaks.com/topic/159681-csv-import-fields/#findComment-842200 Share on other sites More sharing options...
jaymc Posted May 26, 2009 Author Share Posted May 26, 2009 Yes, customers use MS excel so all their data will be converted to CSV so its universal Quote Link to comment https://forums.phpfreaks.com/topic/159681-csv-import-fields/#findComment-842232 Share on other sites More sharing options...
fenway Posted June 2, 2009 Share Posted June 2, 2009 Why not use the CSV engine? Quote Link to comment https://forums.phpfreaks.com/topic/159681-csv-import-fields/#findComment-847701 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.