Answer the question
In order to leave comments, you need to log in
How to show data from different mysql tables?
New to php, please help.
As when clicking on a certain filter link, in the directory in the mysql query, the table changed. For example, you click on Intel core i9, does the cpu-i9 table come out?
I know that it is possible somehow through the GET parameter. Need at least an example
<h5>Фильтр</h5>
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action">Показать все</a>
<a href="#" class="list-group-item list-group-item-action">Intel Core i9</a>
<a href="#" class="list-group-item list-group-item-action">Intel Core i7</a>
<a href="#" class="list-group-item list-group-item-action">Intel Core i5</a>
<a href="#" class="list-group-item list-group-item-action">Intel Core i3</a>
<a href="#" class="list-group-item list-group-item-action">Intel Core Pentium</a>
</div>
<h5>Каталог товаров</h5>
<?php
$sql = $link->query("SELECT * FROM `cpu-i7`");
$link->close;
while($result = $sql->fetch_assoc()): ?>
<div class="media" style="background-color: ">
<img class="mr-2" width="140px" src="<?=$result['img']?>">
<div class="media-body">
<h5 class="mt-0"><?=$result['title']?></h5>
<p><?=$result['text']?></p>
<h5><?=$result['price']?></h5>
</div>
</div>
<? endwhile ?>
Answer the question
In order to leave comments, you need to log in
<a href="?cpu=cpu-i7" class="list-group-item list-group-item-action">Intel Core i7</a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question