Hi,
I have to import all available categories from a pricelist en place them in my webshop.
Now the problem: the id's in the pricelist are alphanumerical, and de id's in my webshop must be integers.
This is what my DB looks like
I've created a TABLE that holds the pricelist:
TABLE pricelist
---------
Prod_id, major_id, minor_id, sub_id
001 AAA2005 BAC3256 GHD6254
And an extra table that holds all the category id's:
The 'shop_cat_id' is auto-increment INT(11):
TABLE categorie_mapping
-------
shop_cat_id, pricelist_cat_id
1 AAA2005
2 BAC3256
3 GHD6254
And it all has to go into this table:
TABLE categories
----------
shop_cat_id, parent_id
3 2
2 1
Major_id is the parent of minor_id and minor_id is of course the parent of sub_id
I thought that by using TABLE categorie_mapping, i could easily convert the category id's into integers. But I'm stuck with creating the SQL to put it in TABLE categories
Can anyone point me in the right direction? Help is really appreciated
I have to import all available categories from a pricelist en place them in my webshop.
Now the problem: the id's in the pricelist are alphanumerical, and de id's in my webshop must be integers.
This is what my DB looks like
I've created a TABLE that holds the pricelist:
TABLE pricelist
---------
Prod_id, major_id, minor_id, sub_id
001 AAA2005 BAC3256 GHD6254
And an extra table that holds all the category id's:
The 'shop_cat_id' is auto-increment INT(11):
TABLE categorie_mapping
-------
shop_cat_id, pricelist_cat_id
1 AAA2005
2 BAC3256
3 GHD6254
And it all has to go into this table:
TABLE categories
----------
shop_cat_id, parent_id
3 2
2 1
Major_id is the parent of minor_id and minor_id is of course the parent of sub_id
I thought that by using TABLE categorie_mapping, i could easily convert the category id's into integers. But I'm stuck with creating the SQL to put it in TABLE categories
Can anyone point me in the right direction? Help is really appreciated