Extract role from database based on credentials by user

Jan 21 2015 1:54 AM
Hi,
I want to extract roles from database and redirect user to other page based on the role i extract after user logs in.
So if role is admin then he will be redirected to some page and if role is user he will be redirected to some other page.
My question is how to write select query where i will compare username and password provided by user.
Thanks in advance for help

Answers (1)