Well, I don't know if it's the best way, but if you look at admin/user.php in the section that starts with "if ($_REQUEST['do'] == 'find')", it's doing something similar in that there are a lot of possible fields you can fill in to search by. It calls fetch_user_search_sql() which is in adminfunctions_user.php, but it just pretty much goes through checkng all the options and adding to the sql as necessary.