Hello,
what is the correct way to update records in following table:
let's say for example that we have 'article 6' with products A, B, C en D.
That would gave me:
id article product order
...
9 art6 A 1
10 art6 B 2
11 art6 C 3
12 art6 D 4
...
Now I display this to the user and he can change the order and/or add, delete products that are linked to the article.
Now my question: what is the best way to update the table?
Can I first delete all the concerning records (thus all the lines with 'art6') and then add the new order and products?
Or should I write a function that checks for existing lines and change the order? In this way the autonumbering id is not growing so fast. I will have to delete the products I removed and add the ones I added.
So when the user selects now 'B,D,A,F,Z' how can I save this in my table?
Please any suggestions.
Thanks.
