Jump to content

csv import based on id via phpmyadmin


thunderousity

Recommended Posts

Hi MySQL experts, I have a small 250 row excel spreadsheet I want to use to popluate an existing table. I need a: the values to be imported in the correct row based on matching id'sb: I also need to ignore inserting into the first two columns (MakeID and Make) So, the last 3 columns of the csv file are inserted into col3,4 and 5 respectively of the mysql table where MakeID is the same. MySQL Table: MakeID, Col2, Col3, Col4 CSV file MakeID, Make, Col3, Col4, Col51, AUDI, 2000, 20, Sometext2, Alfa, 1987, 25, Somemoretext3, Ford, 1999, 30, Evenmoretext I wanted to do this via phpmyadmin but the Import function doesn't seem to allow for this complexity.

Link to comment
Share on other sites

Would it work to delete the Make column and insert the other 4? Why do you need to update versus just inserting the data? If the only thing you're keeping in the row is the MakeID, and the MakeID is also in the spreadsheet, then why not just have the spreadsheet with those 4 columns and insert everything?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...