<?php
$link1 = mysqli_connect($db_host, $db_user, $db_password, $db_database)
or die("Ошибка " . mysqli_error($link1));
$query1 ="SELECT * FROM price__name WHERE id='$id' ";
$result1 = mysqli_query($link1, $query1) or die("Ошибка " . mysqli_error($link1));
if (mysqli_num_rows($result1) > 0)
{
$query1 ="SELECT * FROM price__type, tovar WHERE price__type.proect_id='$id' and tovar.products_id = price__type.id ";
$result1 = mysqli_query($link1, $query1) or die("Ошибка " . mysqli_error($link1));
if (mysqli_num_rows($result1) > 0)
{
$row1 = mysqli_fetch_array($result1);
do
{
?>
<div class="col-12 price__block">
<div class="price__yelow">
<h2><?= $row1['title'] ?></h2>
</div>
<div class="price-row">
<div class="price-8">
<p class="price__title price__title__left">Вид работы</p>
</div>
<div class="price-2 tc">
<p class="price__title">Единица измерения</p>
</div>
<div class="price-2 tc">
<p class="price__title">Стоимость (руб)</p>
</div>
</div>
<div class="price-row price__item">
<div class="price-8">
<p class="price__zag"><?= $row1['tovar'] ?></p>
</div>
<div class="price-2">
<p class="price__count"><?= $row1['many'] ?></p>
</div>
<div class="price-2">
<p class="price__price"><?= $row1['opisanie'] ?></p>
</div>
</div>
</div>
<?php
}
while ($row1 = mysqli_fetch_array($result1));
} }
?>
{categoryId: {name: 'category_name', services: [services_list]}}
и выводить уже подготовленные и отсортированные данные.