Switching mysql to groups_var format