Bonjour!
J'ai créé ma BD et j'ai réussi à l'afficher sur mon site via ce code :
Mais mon problème en est que je ne sais pas comment ajouter d'autres données à ma tables "patients" via ce formulaire qui comporte 5 colones dont 4 pour le remplissage:
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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 <?php //Connection avec la BDD. mysql_connect("localhost", "root", ""); mysql_select_db("cisco_sante"); $reponse = mysql_query("SELECT * FROM patients"); ?> <table width="800"> <tr> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">Date</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">IPM</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">Numéro</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">Nom</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">C</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">K</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">KR</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">V</th> <th colspan="5" style="border-radius: 5px; background-color: #079839; height: 30px;">Montant</th> </tr> <?php //On affiche les lignes du tableau une à une à l'aide d'une boucle while($donnees = mysql_fetch_array($reponse)) { ?> <tr bgcolor="#CCCCCC" align="center"> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['date'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['ipm'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['numero'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['nom'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['c'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['k'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['kr'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['v'];?></td> <td colspan="5" style="border-radius: 5px" scope="col"><?php echo $donnees['montant'];?></td> </tr> <?php } //fin de la boucle, le tableau contient toute la BDD mysql_close(); //deconnection de mysql ?> </table>
En fait, je sais pas quel code mettre dans le "patient_ajout.php" !
Code html : 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
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 <table width="500" align="center"> <td> </td> <th colspan="4" style="border-radius: 5px; background-color: #079839; height: 30px;"> Veillez insérer un ou plusieurs nouveaux patients </th> <td></td> <form action="patient_ajout.php" method="post"> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">Date</th> <td style="border-radius: 5px"> <input type="date" name="date"/> </td> <td style="border-radius: 5px"> <input type="date" name="date"/> </td> <td style="border-radius: 5px"> <input type="date" name="date"/> </td> <td style="border-radius: 5px"> <input type="date" name="date"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">IPM</th> <td style="border-radius: 5px"> <input type="text" name="ipm"/> </td> <td style="border-radius: 5px"> <input type="text" name="ipm"/> </td> <td style="border-radius: 5px"> <input type="text" name="ipm"/> </td> <td style="border-radius: 5px"> <input type="text" name="ipm"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">Numéro</th> <td style="border-radius: 5px"> <input type="text" name="numero"/> </td> <td style="border-radius: 5px"> <input type="text" name="numero"/> </td> <td style="border-radius: 5px"> <input type="text" name="numero"/> </td> <td style="border-radius: 5px"> <input type="text" name="numero"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">Nom</th> <td style="border-radius: 5px"> <input type="text" name="nom"/> </td> <td style="border-radius: 5px"> <input type="text" name="nom"/> </td> <td style="border-radius: 5px"> <input type="text" name="nom"/> </td> <td style="border-radius: 5px"> <input type="text" name="nom"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">C</th> <td style="border-radius: 5px"> <input type="text" name="c"/> </td> <td style="border-radius: 5px"> <input type="text" name="c"/> </td> <td style="border-radius: 5px"> <input type="text" name="c"/> </td> <td style="border-radius: 5px"> <input type="text" name="c"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">K</th> <td style="border-radius: 5px"> <input type="text" name="k"/> </td> <td style="border-radius: 5px"> <input type="text" name="k"/> </td> <td style="border-radius: 5px"> <input type="text" name="k"/> </td> <td style="border-radius: 5px"> <input type="text" name="k"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">KR</th> <td style="border-radius: 5px"> <input type="text" name="kr"/> </td> <td style="border-radius: 5px"> <input type="text" name="kr"/> </td> <td style="border-radius: 5px"> <input type="text" name="kr"/> </td> <td style="border-radius: 5px"> <input type="text" name="kr"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">V</th> <td style="border-radius: 5px"> <input type="text" name="v"/> </td> <td style="border-radius: 5px"> <input type="text" name="v"/> </td> <td style="border-radius: 5px"> <input type="text" name="v"/> </td> <td style="border-radius: 5px"> <input type="text" name="v"/> </td> </tr> <tr> <th style="border-radius: 5px; background-color: #079839; height: 30px;">Montant</th> <td style="border-radius: 5px"> <input type="number" name="montant"/> </td> <td style="border-radius: 5px"> <input type="number" name="montant"/> </td> <td style="border-radius: 5px"> <input type="number" name="montant"/> </td> <td style="border-radius: 5px"> <input type="number" name="montant"/> </td> </tr> <th style="border-radius: 5px"> </th> <td style="border-radius: 5px"></td> <td style="border-radius: 5px" align="center"> <input type="submit" name="valide" value="Valider" /> </td> <td style="border-radius: 5px" align="center"> <input type="reset" nom="reset" value="effacer" /> </td> </form> </table>
Qui peut me donner la ou une autre solution pour ce problème ?
Merciii!!!!
Partager