I have been trying to limit the number of records that a user can have in a particular table if they belong to a certain group but in another group they can have more records.
I set the number of records in the hooks file but realised that if I change the user to a different group, the membership_userrecords table says that the record belongs to the previous group.
Is there any way to change this without having to do it one by one which isn't practical?
Change members record to a different group
Re: Change members record to a different group
Not sure how you assign the groups bruceholt, if you do from the admin pages it should automatically reassign them but if you do this in hooks then maybe this will work, not tried it so use with care?
Code: Select all
$group = $memberInfo[groupID]; //Assumes you have already moved the user to the new group?
$username = $memberInfo[username];
sql("UPDATE `membership_userrecords` SET `membership_userrecords`.`groupID` = $group WHERE `membership_userrecords`.`memberID` = '".$username."' ", $eo);
AppGini 22.13
Re: Change members record to a different group
Hi Angus,
Thanks. Which hooks file should I put that in?
Thanks. Which hooks file should I put that in?
Re: Change members record to a different group
Can I check how you are updating the user from one group to another?
AppGini 22.13
Re: Change members record to a different group
Through admin, Angus.
Re: Change members record to a different group
from my understanding then Bruce this should be applied automatically after you amend the group
AppGini 22.13
Re: Change members record to a different group
Thanks Angus. From what I can tell, the user records in the table stay as the previous group.