Since what you have described (limiting to 2 or 3 set dropdown selections) is more of a filter than a search (which would be more ‘freeform’), I would be more inclined to use built in functions rather than write a SQL query (although you are on the right track with that as well).
You could get all users using the function get_users, then loop through that list. For example, if you wanted to show a list of doctors that spoke Spanish (assuming you had a meta key of “language” and “Spanish” was one of the possible values:
<?php
$users = get_users();
foreach ($users as $user) {
$last_name = get_user_meta( $user->ID, 'last_name', true );
$spanish = get_user_meta( $user->ID, 'language', true );
if( $spanish == 'Spanish' ) {
echo 'Dr. ' . $last_name . '<br />';
}
}
?>
This would get all users, then loop through the resulting array, testing for the meta value of “Spanish” using get_user_meta and if it was there, then displaying accordingly.
You could build on this concept significantly, such as allowing for additional conditions, and you’ll need to collect the parameters from the search form.
Also, get_users allows you to retrieve the meta values you ask for as part of the array so you could eliminate the get_user_meta step and have something like $user->last_name and $user->language, but that gets a little more complicated because you need to understand how to pass the arguments to get_users() as an array.
You could potentially use or combine this with get_userdata as well.
I think that’s probably easier in the long run than using SQL queries directly. Hope that helps.