Can someone let me know how I can fetch an attribute depending on the value of two columns. For eg, in my usr_preference table I have 3 columns; 

username, domain, attribute. 

I need to fetch the attribute if the username = $ru and domain= $rd. Can someone let me know how this can be done, thanks.

Arun