The complexity here is that the membership (B) in the database is based on the existence of a record in the set B and that, as +Andrew Smith
says, the http POST only includes attributes that are checked.
To begin to unpack this, I'll assume that you have a CRUD form for people (A) and want to extend this to give a list of attributes (C) that has a list for person (A) that includes the name (C) and a checkbox the user can check if membership is needed.
I'll also assume you are PHP, but the logic below applies to any language.
Stage 1). When you load the data for A into your data model, also load the membership data.
a) select B.id_b as b_id, C.id_c as c_id, C.name as c_name from B outer join C on B.id_b = C.id_c where a_id = whatever
Put this in a pair of PHP arrays ... for each row in the result set:
This map will have the membership state (b_id or null) for each c record along with the associated names.
Stage 2) To generate the output list from the data model, generate an unordered list (UL, LI) where each LI has a checkbox (input with type="checkbox") and a name made up of c_id and a prefix you allocate. Include the c_name for the ID so the user knows what they are checking.
Stage 3) on a post back, check each post field for the names you have allocated in 2 above as +Andrew Smith
suggests. This will tell you whether the membership is checked in the post data.
Stage 4) Update logic
a) if the name in the post data is present and true
If the ids[c_id] === null, insert a B record, otherwise do nothing
b) if the name in the post data is absent or not true
If the ids[c_id] !== null, delete the B record, otherwise do nothing.