Par le biais d'un simple formulaire rempli par l'utilisateur
On récupère les données puis je l'insère dans ma BD
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <form method="post" action="fichecommande.php" enctype="multipart/form-data"><table > <tr> <th valign="top">Nom du Professeur:</th> <td><input type="text" name="nomprof" /></td> <td></td> </tr> <tr> <th valign="top">Nom du Materiel:</th> <td><input type="text" name="nommateriel" /></td> </tr></table></form> </tr>
et je les affiche dans ma page
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <?php $nommateriel=$_POST["nommateriel"];$Nomprof=$_POST['nomprof']; $req="INSERT INTO COMMANDE_BESOIN(id_commandeb, NOM_MATERIEL,nom)VALUES( '','$nommateriel','$Nomprof')"; $res = $conn->query($req); ?>
voici et comme vous le voyez je voudrai afficher le id commande (ma clé primaire auto-incrémenté) dans cette fiche commande qui apparait à l'utilisateur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <form method="post"> <table> <tr> <th valign="top">Id Commande:</th> <td><?php <!--où je veux afficher le id commande--> ?> </td> <td></td> </tr> <tr> <th valign="top">Nom du Materiel:</th> <td><?=$nommateriel?> </td> <td></td> </tr> <tr> <th valign="top">Nom du Professeur:</th> <td><?=$Nomprof?> </td></td> </tr></table></form>
comment faire ????????
Partager