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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.