bonjour à tous. j'ai une préoccupation. j'ai un formulaire de modification contenant une liste déroulante qui doit avoir à sa tete la donnée à modifier provenant de la BD et le reste des données provenant aussi de la BD. l'element à modifier a sa requette à part et le reste a aussi sa requette différente de la première. comment puis-je faire?. voici le code que j'ai essayer de réaliser:
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
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
75
76
77
78
79
80
81
82
83
84
85
86
<?php
 if(isset($_GET['id']))
  {$i=$_GET['id'];}
  $base2 = mysql_connect ('127.0.0.1', 'root', ''); // parametres de connexion à la base
 mysql_select_db ('home', $base2)or die ("erreur de connexion base") ;
 
<div id="div_entity">
 
<form action= "modif.php?id=<?php echo $i;?>" method="POST" id="form_insert" accept-charset= "iso-8859-1">				
<div class="form" align="center">
 <div id="bloc1" style="background:white; border:solid 1px blue;">			
 
 
<table cellspacing="0" class="form" cellpadding="0" width="" style="display:inline-block;">
 
    <colgroup>
	<col width="90%"></col><col width="20%"></col>
   </colgroup>
   <tbody>
        <tr>
           <td align="center" style="vertical-align:top;">
	<fieldset align="left" style="border-radius: 5px 5px 5px 5px; display:inline-block; border: 1px groove darkgray; margin:10px; width:95%">
	    <legend>
                      Veuillez remplir le formulaire
                 </legend>
 
	   <table cellspacing="0" class="form" cellpadding="0" width="" style="display:inline-block;">
	        <colgroup>
		<col width="60%"></col><col width="30%"></col>
	        </colgroup>
	       <tbody>
		<tr>
		    <td align="center" style="vertical-align:top;">
		       <fieldset align="left" style="border-radius: 5px 5px 5px 5px; display:inline-block; border: 1px groove darkgray; margin:10px; width:95%">
									<legend>Informations relatives à la plate forme</legend>
									  <?php
  $sql= 'select plate_forme.nom_plate,plate_forme.localisation,site.nom,plate_forme.id_site,site.id_site from plate_forme,site where id_plate="'.$i.'" and plate_forme.id_site=site.id_site';
 $res=mysql_query($sql) or exit(mysql_error());
  while($data1 = mysql_fetch_array($res))
   {  echo '
        <table id="tab_entity"  cellspacing="0" class="form" cellpadding="0" width="100%">
	<colgroup>
	   <col width="20%"><col width="35%">
                <col width="20%"><col width="35%">
             </colgroup>
	<tbody>
	     <tr>
										
	           <input id="Code" name="id" value="" type="hidden" />												
	           <td class = "label" align = "right">Nom de la plate forme</td>			
                         <td><input  class="input_type "  type="text" id="nom" name="nom_plate" value="'.$data1['nom_plate'].'"/>&nbsp;</td>		
                  </tr>	
          	</tr>	
              <tr>										
	   <td class = "label" align = "right">Localisation</td>
										
                <td><input  class="input_type" "  type="text" id="localisation" name="localisation" value="'.$data1['localisation'].'" />&nbsp;</td>
              </tr>
              <tr>
                   <td class = "label" align = "right">Nom du site hôte</td>
                   <td><select class="input_type " style="width: 276px;" name="nom"> 
		$sql2 = "select * from site";
		$req2 = mysql_query($sql2) or die(mysql_error());
		$sql = "select plate_forme.id_plate,plate_forme.id_site,site.id_site,site.nom from site, plate_forme where plate_forme.id_site=site.id_site and plate_forme.id_plate="'.$i.'"";
		$req = mysql_query($sql) or die(mysql_error());
		while($data = mysql_fetch_array($req))
                                {
		        <option value="'.$data['id_site'].'">'.$data['nom'].'</option>
                                 }
		while($data2 = mysql_fetch_array($req2))
                              {
		       <option value="'.$data2['id_site'].'">'.$data2['nom'].'</option>
                               }
	   </select></td>										
										
                </table>
	        	</legend>	
			</fieldset>			
			<input style="margin:5px;" type="submit" name="valider" class="tpl_button_insert"  value="Modifier">&nbsp;  
			<input style="margin:5px;" type="submit" name="retour" class="tpl_button_insert" value="Retour"> 
	</legend>
</fieldset>	
 
</table></table>	
</div></div>
 </form>';}?>
ce code me renvoie l'elément à modifier et un seul element du reste de la liste à generer issu de la deuxième requette. aparament celle-ci ne s'exécute qu'une seule fois. MERCI d'avance!