1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| // tableau des valeurs à passer dans le IN
$tb_IN = explode(',',$this->id_produit_modifier );
var_dump($tb_IN);
// Crée une chaîne pour les marqueurs
$place_holders = implode(',', array_fill(0, count($tb_IN), '?'));
$sth =Bdd::getIntance()->prepare("SELECT * FROM produit WHERE idProduit IN ($place_holders)"); // IN ($this->id_produit_modifier)");
$sth->execute($tb_IN);
echo '<a href="index.php">revenir</a>';
echo "<table>";
echo "<tr><th>numéro</th><th>nom</th><th>prix</th><th>afficher/cacher</th></tr>";
while($r = $sth->fetch(PDO::FETCH_OBJ)) {
echo "</tr>
<td>$r->nom</td>
<td>$r->prix</td>
<td>show</td>
</tr> ";
}
echo "</table>"; |
Partager