Hi!,
can some help me with a problem?
Here are my tables: User, Profiles, and one for "Profiles per user"
In the last one, I save the ID of the user and the ID of the profiles for that user. This profiles are selected through checkboxes. My question is, What's the best way to update the records on the database?,
because there's three scenarios, they selected a new profile (INSERT), they leave like it was (NOTHING), or they unselected a profile (DELETE).
But I can't figure out a "nice" way to do this. Should I just erase all the records from the table, and then insert all the new ones even if there are unchaged records?,
Any ideas?