Dynamic Roles

Hi,

am struck with roles managemrnt,

i have a table with 3 fields


    1.id, 


    2.rolename,


    3.userid,


        i want to give roles at the time of user creation,so plz help me