Answer the question
In order to leave comments, you need to log in
How to correctly display data from mysql?
The task is to display a list of branches. At the moment, only two countries need a withdrawal, but it is better to do it for an infinite number.
Currently 2 requests are in use
SELECT * FROM filialy WHERE fed_okr_id IN(8) AND activity = 1 ORDER BY city
SELECT * FROM filialy WHERE fed_okr_id IN(1,2,3,4,5,6,7,9) AND NOT id = 29 AND activity = 1 ORDER BY city
<div class="mb-1">
Россия:
<?php
while ($row = mysqli_fetch_array($dealers_russia)) { ?>
<a href="/filialy/<?=$row['link_filial']?>"><span class="badge badge-primary"><?=$row['city']?></span></a>
<?php
}
?>
</div>
<div class="mb-1">
Кахастан:
<?php
while ($row = mysqli_fetch_array($dealers_kz)) { ?>
<a href="/filialy/<?=$row['link_filial']?>"><span class="badge badge-primary"><?=$row['city']?></span></a>
<?php
}
?>
</div>
SELECT filialy.city, filialy.link_filial, city.name_city, city.countyId
FROM filialy
INNER JOIN city ON filialy.cityId = city.id_city
WHERE filialy.activity = 1
ORDER BY filialy.city
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question