Good afternoon I created a system of category of products in the store that I am putting in it I have a page that calls for get the categories but I have a problem I have more than one category per product and I am not able to do list it so much in one category as in the other. if somebody can help thanks, I'll leave the part of the index that calls the get of the category page and the page of the category obs: in my database I created a field in the table called category and another called subcategory.
part of the index that calls get from the category category:
<div class="col-md-6">
<div class="thumbnail">
<a href="category.php?category=esportes"><img src="images/prod1.jpg" alt="esportes" class="acende" title="esportes"></a>
<span class="esporte">Esportes</span>
</div>
</div>
<div class="col-md-3">
<div class="thumbnail">
<a href="category.php?category=running"><img src="images/run_prod.jpg" class="acende" title="running"></a>
<span class="resto">Running</span>
</div>
</div>
In this example I have a category listing for sports and running suppose I have a product that are of these two categories I registered in the running category and the sport subcategory as I could do for it to list the msm product in the two categories if I am doing wrong please explain me in a simple and effective way or if it is not that way I appreciate any information.
now the category page
<?php
$categoria = $_GET['category'];
$quantidade = 24;// qunatidade que ira aoparecer por pagina
$pagina = (isset($_GET['pagina'])) ? (int)$_GET['pagina'] : 1;
$inicio = ($quantidade * $pagina) - $quantidade;
$sql = "SELECT * FROM filme WHERE categoria = '$categoria' ORDER BY nome LIMIT $inicio, $quantidade";
?>
Here are my codes if anyone can help thanks.