Please help searching a field in member database

I need a code that does a search on member database to verify that a field has been filled in order to create some actions on the page. I am not able to use the query function for this. Can someone help me please?? An example would be very welcome.