Mise à jour table via formulaire
Bonjour,
Je suis en train de créer un formulaire de mise à jour de mes articles pour la partie quantité, le reste est en disabled
Mais lorsque que je clique sur submit je ne récupère pas les valeurs de mes variables.
Ma page formulaire :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| <form action='modification.php' method='POST'>
<?php
$query = "SELECT * FROM ARTICLE
INNER JOIN FOURNISSEUR
ON ARTICLE.num_four=FOURNISSEUR.num_four
WHERE num_article = $variable ";
$result = mysqli_query($connexion, $query);
// Afficher les lignes du tableau en fonction de la réponse à la requête
if ($result) {
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "</br></br>";
echo "<td height='1%' align='right'></td>";
echo "<td height='1%' align='left'><font size='6'>Mettre à jour un article</font></td>";
echo "</tr>";
echo "<tr>";
echo "</br></br>";
echo "<td height='1%' align='right'>Référence de l'article : </td><td><input type='text' disabled='disabled' name='ref' value='".$row['ref_article']."'/></td>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'>Description de l'article : </td><td><textarea disabled='disabled' name='nomart' rows='5' cols='50'>".$row['nom_article']."</textarea></td>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'>Quantité de Vincent :</td> <td><input type='text' name='qtevince' value='".$row['qte_vincent']."'/></td>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'>Quantité de Peggy :</td> <td><input type='text' name='qtepeggy' value='".$row['qte_peggy']."'/></td>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'>Quantité de Benoit :</td><td> <input type='text' name='qtebenoit' value='".$row['qte_benoit']."'/></td>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'>Image :</td><td> <input type='text' disabled='disabled' name='imgart' value='".$row['img_article']."'/></td>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'>Fournisseur :</td>";
echo "<td height='1%' align='left'>
<input disabled='disabled' type='text' name='fournisseur' value='".$row['nom_four']."'/>
</td>";
echo "</tr>";
echo "<tr height='1'>";
echo "<input type='hidden' name='numarticle' value='".$row['num_article']."'/>";
echo "</tr>";
echo "</br></br>";
echo "<tr>";
echo "<td height='1%' align='right'><input name='submit' type='submit' value='Envoyer'></td>";
echo "</tr>";
}
}
}
?>
</form> |
et ma page d'exécution de la requête de mise à jour (pour le moment j'essai d'afficher les valeurs de mes variables pour voir si je récup les bonnes valeurs.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?php
if(isset($_POST['submit'])) {
// Réecriture des variables
$ref_article=$_POST['ref'];
$nom_article=$_POST['nomart'];
$qte_vincent=$_POST['qtevince'];
$qte_peggy=$_POST['qtepeggy'];
$qte_benoit=$_POST['qtebenoit'];
$img_article=$_POST['imgart'];
$num_article=$_POST['numarticle'];
echo .$ref_article.;
echo .$qte_vincent.;
}
?> |
Merci d'avance