1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <?php
try{
$bdd = new PDO ('mysql:host=localhost;dbname=giphar', 'root', '');
}
//si connexion ne marche pas on ferme le programme
catch(Exception $e){
die('Erreur :'.$e->getMessage());
}
$i = 0;
$req = $bdd ->query('SELECT nomP FROM produit');
while ($a = $req ->fetch()) {
$i++;
?>
<form class="" action="../Vues/v_FicheP.php" method="post">
<h3> Nom Produit n° <?php echo $i; ?> : </h3>
<input type="text" name="nP" value="<?php echo $a['nomP']; ?>" readonly="">
<input type="submit" name="btnFicheP" value="fiche produit">
</form>
<?php }?>
<p>votre stock est composé de : <?php echo $i; ?> produits</p> |