Есть код:
<?php
$techs = mysqli_query($db, "SELECT id FROM tech WHERE user='$uzver[id]' AND status!='delete'");
if($tech = mysqli_fetch_array($techs)) {
$totalPrice = 0;
do {
$tech_cat = $tech['id'];
$remont_tech = mysqli_query($db, "SELECT id,data,work_id,sum,master, DATE_FORMAT(data,'%d.%m.%Y') As data FROM remont_tech WHERE tech_id='$tech_cat' AND status='normal' AND TO_DAYS(NOW()) - TO_DAYS(data) <= 7 ORDER BY DATE(data)");
foreach ($remont_tech as $oplata) {
$totalPrice += $oplata['sum'];
}
} while($tech = mysqli_fetch_array($techs));
echo "<div class='title_input'> Оплат за 7 дней:</div> $totalPrice Руб.<br>";
}
?>
Подскажите как два запроса таких можно объеденить в один