I've searched around, but couldn't find anything specifically like this problem:
I wrote a PHP script to go into a few of my mySQL tables and kick out a spreadsheet of proucts so i can easily edit them in Excel. The results are like this:
products 1 2 3 4 5
2800770 red large heavy cheap rough
2801000 blue medium light cheap smooth
2801010 yellow small heavy so-so lumpy
2801020 green medium zero insane waffled
2801030 orange large light cheap smooth
1,2,3,4,5 are label_id
red, large, etc. are label_values
This works great for my editing. Unfortunately, I need to re-import the information, and i need it to to into the below table.
products label_id label_value
2800770 1 red
2800770 2 large
2800770 3 heavy
2800770 4 expensive
2800770 5 rough
I know this involves creating arrays from the csv file, but i'm really stumped. I can't seem to get started. I'd appreciate any help.