Sorry I've not had time to role a patch but on the following lines the table names need the curly braces.

1099: $valid_role_sql = "select rid from role where name='%s'";
1108: $nmrole_sql = "select rid from og_multi_mand_groups_role where role_name='%s'";
1118: $tempsql = "SELECT rid from role where name='%s'";

Thanks for a great module.

Si.