if($fetch_result[fabricator] !== 'NOPE') {
$sub_result0 = queryMySQL("SELECT id,first_name,second_name,company FROM users WHERE id='$fetch_result[fabricator]' ORDER BY id DESC");
$sub_fetch_result0 = mysqli_fetch_array($sub_result0);
}
if($fetch_result[printer] !== 'NOPE') {
$sub_result1 = queryMySQL("SELECT id,user,first_name,second_name,company FROM users WHERE id='$fetch_result[printer]' ORDER BY id DESC");
$sub_fetch_result1 = mysqli_fetch_array($sub_result1);
}
if($fetch_result[agent] !== 'NOPE') {
$sub_result2 = queryMySQL("SELECT id,user,first_name,second_name FROM users WHERE id='$fetch_result[agent]' ORDER BY id DESC");
$sub_fetch_result2 = mysqli_fetch_array($sub_result2);
}
if($fetch_result[courier] !== 'NOPE') {
$sub_result3 = queryMySQL("SELECT id,user,first_name,second_name FROM users WHERE id='$fetch_result[courier]' ORDER BY id DESC");
$sub_fetch_result3 = mysqli_fetch_array($sub_result3);
}
Есть вот такой индусский запрос, как наиболее эфективно скомпоновать из 4 запросов в 1?