I will say it one more time: That is *TERRIBLE TERRIBLE* database design.
Even if you only read the first few paragraphs of any book or article on DATABASE NORMALIZATION you will learn that. And any GOOD book or article on database design *WILL* include a section on normalization, guaranteed.
But if you are going to do this despite what any database designer will tell you, then at least show us the *CODE* that you say is not working.
What does the design of your table NMGroups look like, for starters? What does the SQL query that you are using to do UPDATE NMGroups ... look like?
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.