Не работает.
$address = mysqli_fetch_assoc($result);
var_dump($address);
$is_deleted = mysqli_query($resource, "DELETE FROM addresses WHERE id = {$address['id']};");
var_dump($is_deleted);
$is_updated = mysqli_query($resource,"INSERT INTO payments VALUES ($userId, $productPrice)");
var_dump($is_updated);
echo mysql_error();
<?php
// запрос данных
$query_result_1 = $db->query("SELECT...");
$data_1 = $query_result_1->fetch_all();
$query_result_2 = $db->query("SELECT...");
$data_2 = $query_result_2->fetch_all();
// вывод результата по формату/шаблону
$out = '';
foreach($data_1 as $data)
$out .= '<p>'.$data['field'].'</p>';
foreach($data_2 as $data)
$out .= '<p>'.$data['field'].'</p>';
echo $out;
?>
group by b.lot_id,
l.id,
c.name,
l.title,
l.image_path,
l.start_price