bonjour, regardez avec moi ce code normalement il est pour insertion plusieurs enregistrement en même temps la première étape marcha avec succé mais dans la deuxième il ma dis que tous les enregistrement sont ajouté mas réalement le dernier seulement qui est ajouter a la base
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
 
<?php if(!isset($_POST['etape'])) { ?>
<h3>Etape 1 :: Nombre des étudiant </h3>
<form action="" method="post" name="etudiant" id="etudiant">
  <input name="etape" type="hidden" value="1" />
  <table width="407" border="0" align="center" cellpadding="1" cellspacing="1">
    <tr>
      <td width="199">Entrer le nombre des etudiant </td>
      <td width="201"><input name="nombre" type="text" size="10" />
        &nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="suivant" type="submit" value="Suivant" />
        &nbsp;</td>
    </tr>
  </table>
</form>
<p>
  <?php } else { ?>
</p>
<p>&nbsp;</p>
<h3>Etape 2 :: Saisie des donn&eacute;es </h3>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1"id="form1">
  <input name="etape2" type="hidden" value="2" />
  <input name="nb_etudiant" type="hidden" value="<?php echo $_POST['nombre']; ?>" />
  <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td width="14%" bgcolor="#FFAD5B"><span class="Style5">Numero d inscription</span></td>
      <td width="10%" bgcolor="#FFAD5B"><span class="Style5">Nom de module</span></td>
      <td width="11%" bgcolor="#FFAD5B"><span class="Style5">Controle1</span></td>
      <td width="12%" bgcolor="#FFAD5B"><span class="Style5">Controle2</span></td>
      <td width="10%" bgcolor="#FFAD5B"><span class="Style5">TD</span></td>
      <td width="10%" bgcolor="#FFAD5B"><span class="Style5">TP</span></td>
      <td width="12%" bgcolor="#FFAD5B"><span class="Style5">Syntyse</span></td>
      <td width="11%" bgcolor="#FFAD5B"><span class="Style5">Rattrapage</span></td>
    </tr>
    <?php for($i=0;$i<$_POST['nombre'];$i++){ ?>
    <tr>
      <td bgcolor="#FFF4EA"><input name="numero_inscription" type="text" id="numero_inscription" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><select name="m_code" id="m_code">
        <?php
do {  
?>
        <option value="<?php echo $row_rs_module['m_code']?>"><?php echo $row_rs_module['m_nom']?></option>
        <?php
} while ($row_rs_module = mysql_fetch_assoc($rs_module));
  $rows = mysql_num_rows($rs_module);
  if($rows > 0) {
      mysql_data_seek($rs_module, 0);
	  $row_rs_module = mysql_fetch_assoc($rs_module);
  }
?>
      </select></td>
      <td bgcolor="#FFF4EA"><input name="controle1" type="text" id="controle1" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="controle2" type="text" id="controle2" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="TD" type="text" id="TD" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="TP" type="text" id="TP" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="syntyse" type="text" id="syntyse" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="rattrapage" type="text" id="rattrapage" value="" size="10" /></td>
    </tr>
    <?php } ?>
  </table>
  <div align="right">
    <input type="hidden" name="MM_insert" value="form1" />
    <input type="submit" name="Submit" value="Insérer" />
  </div>
</form>
<?php } ?>