db_set_active('mydatabase');
$query = db_select('mytable', 'c');
$query->fields('c', array('number','email_address'))
->condition('number', $phoneval, '=')
->condition('email_address', $mailval, '=');
$result = $query->execute()->fetchAll();
You could use nested if
if (empty($result)) {
// do print_r($result);
// here you will get the result in array
if (empty($result[0]$result['number'])) {
form_set_error('phone_number','We have no record of that Assessment Number');
} else if(empty($result[1]$result['email_address'])) {
form_set_error('mail''email_address','We have no record of that email');
}
}