Koman mwen ka fe poum rezoud problem sa
<?php
$query=$conn->prepare('SELECT * FROM products');
$query->execute();
WHILE($products=$query->fetch()){
?>
<div>
<a href="products-single.php?id=<?=$products['id_products']?>">
<div class="slider_items">
<img src="upload/products/<?=$products['image_products1']?>" alt="">
<div class="product-same-detail1">
<a href="" title="Add to cart"><i class="fa-solid fa-cart-shopping"></i></a>
<a href="" title="Buy now"><i class="fa-solid fa-money-check-dollar"></i></a>
</div>
<div class="product-same-detail">
<h1><?=$products['name']?></h1>
<?php
$query=$conn->prepare('SELECT * FROM artist JOIN products ON artist.id_artist=products.id_artist WHERE id_products=?');
$query->execute();
WHILE($artist = $query->fetch()){
?>
<p class="auteur"><?= $artist['firstname'] ?> <?= $artist['lastname'] ?></p>
<?php
}
?>
<p class="text-dark"></p>
<p class="text-dark"><?= $products['width'] ?> x <?= $products['length'] ?> x <?= $products['weight'] ?></p>
<p class="prix"><?=$products['price']?>$</p>
</div>
</div>
</a>
</div>
<?php
}
?>
Huguens Paul 30 Octobre 2022PHPRésolu 1
mesaj erè an trè eksplisit nan rekèt ou fè a ou mete yon kloz where id_products=? epi nan execute lan ou pa met anyen