Bonjour :j'ai un probleme d'affichage: je m'exprime, j'ai crée une form qui contient un checkbox contenant les chap,s que l'utilisateur veut afficher mais le probleme c'est comment afficher les resultat sachant que ma requete marche tres bien et voile :
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 <html> <body> <font color=yellowgreen><h3 align=center><u>Choisissez les champs que vous voulez afficher !</u></font><br><br> <form method="POST" action="affiche2.php"> <center> <table bgcolor=yellowgreen> <tr> <td><u><font color=white>Champs : </u></font></td> <td><input type=checkbox name=champs value="Code_Ouvrage"><font color=white>Code ouvrage</font></td> <td><input type=checkbox name=champs value="Titre"><font color=white>Titre</font></td> <td><input type=checkbox name=champs value="Discipline"><font color=white>Discipline</font></td> <td><input type=checkbox name=champs value="Auteur_principal"><font color=white>Auteur principal</font></td> <td><input type=checkbox name=champs value="Prix_achat"><font color=white>Prix achat</font></td> <td><input type=checkbox name=champs value="Date_achat"><font color=white>Date achat</font></td> <td><input type=checkbox name=champs value="Affectation"><font color=white>Affectation</font></td> </tr> </table> <br> <center><INPUT TYPE="SUBMIT" name="val" VALUE="Afficher"> </form> </body> </html>Veuillez m'aider !
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 <html> <body> <? mysql_connect("localhost", "root", "")or die ("Impossible de se connecter"); mysql_select_db ("biblio")or die ("Impossible d'accéder à la base de données"); $champs=$_POST['champs']; $requete="SELECT $champs FROM ouvrage "; $result=mysql_query($requete); echo '<font color="Blue"><u><center>Maria</u></font><br><br><br>'; while($res = mysql_fetch_array($result)) { echo $res['Titre']."<br>"; } ?> </body> </html>
Partager