I think in the end you are best off to just delete all appropriate rows and then insert the currently selected ones.
Think about it this way... what makes more sense:
A) select current rows from DB, loop thru results, test against current selected items, figure out which to remove, remove them, add new ones.
B) Remove all applicable rows, add all selected items.
Why do all that extra work in option A)? It's going to be less efficient and more hastle.
Peter
------------------------------------------------------
Work smarter, not harder.
|