0
Well, I’d like to know if there’s a better way: he looks for everything that has skin_type==2, and I wanted to make several types to sell, I would have a way to pick up item by item and put in a div or just like picking up everything ?
<?php
$consulta = $pdo->prepare("SELECT * FROM homesite");
$consulta -> execute();
$linhas = $consulta -> rowCount();
foreach($consulta as $mostra):
?>
<div class="card">
<?php
if ($mostra['skin_tipo'] == 2) {?>
<img class="skin"src="images/<?= $mostra['skin_img']?>" alt="Nome da Empresa:
<?= $mostra['skin_nome']?>" title="Nome da Empresa: <?= $mostra['skin_nome']?>">
<div class="info">
<h1 class="color-white text-center font-text-light-med font-weight-heavy bgcolor-black"><?= $mostra['skin_nome']?></h1>
</div>
<p class="preccor">Por: R$ <?= number_format($mostra['skin_preco'], 2,',','.')?></p>
<button class="bgcolor-red text-center btn"><a href="comprar.php?prod=<?= $mostra['id_skin']?>">Comprar</a></button>
<?php } ?>
</div>
<?php endforeach; ?>
You want to show only what is skin_type=2?
– Diego Marques
That I have done, I wanted to pick up item by item, that I have the skin_type == 2, so that I did it all, because I wanted to make a caroulse with each item that has type = = 2
– Felipe
I’m trying to pick up by the id, but it still picks up all the field record, and I wanted to pick up only 1 at a time..
– Felipe
@Leocaracciolo I was wanting to pull separately each ( product that is registered in the database), and at the time my code searches all products registered in mysql and not 1 by 1 ex: if I go there by id, will appear 5 even if I have set to only id = 1.
– Felipe
I wanted to pick separately item by item, to make a Carousel
– Felipe
i used an if ($shows['id_skin'] =1)
– Felipe
but even with this if appears everything you have in the table.
– Felipe
@Leocaracciolo in this case the best to use is this from homesite Where id=1? but then I would have to do this for all ex items if I want to get 5, would that be 5 from homesite Where, is there any cleaner way to do that? I wanted to create kind of a slide with products .
– Felipe
@Leocaracciolo and would have made a Carousel pulling between the 5 and 10? Because the Carousel would need items separately no?
– Felipe
@Leocaracciolo is exactly this Carousel that is in the news section. http://www.neshastore.com/
– Felipe
Let’s go continue this discussion in chat.
– user60252
your problem is riding the carousel right? enters the chat
– user60252