Hi,
I'm having trouble getting my head around INSERT...... ON DUPLICATE at the moment.
I have three tables,
Product details:
id, description.....
Categories
type, value
Product Categories
product_id, category_value
Example data for the Categories table:
height, short
height, tall
colour, red
colour, blue.
What I want to do is have no more than one entry for each category 'type' for each product (i.e. a product can be tall and red but not tall and short).
I was hoping to do this with INSERT...ON DUPLICATE as this means when a user changes a product from red to blue I don't have to do "if colour exists delete colour insert new colour".
Thanks for any and all help!