bonjour à tous depuis hier je cherche le problème dans mon code. j'arrive pas a savoir pourquoi il n 'a pas d'insertion dans ma table
voici la stucture de ma table:

Code sql : 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
--
-- Base de données: `bdd`
--
 
-- --------------------------------------------------------
 
--
-- Structure de la table `etat_taxation`
--
 
CREATE TABLE IF NOT EXISTS `etat_taxation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_impos` varchar(60) NOT NULL,
  `noms` varchar(200) NOT NULL,
  `ncc` varchar(30) NOT NULL,
  `ref_facture` varchar(60) NOT NULL,
  `natur_bien` varchar(60) NOT NULL,
  `montant_total` varchar(30) NOT NULL,
  `mont_tax_deduct` varchar(30) NOT NULL,
  `code` int(11) NOT NULL,
  `get_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
COMMIT;

et voici mon code :
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 
<?php
if(!isset($_SESSION['pseudo'])){
header("location: index.php?page=BIENVENUE");
}
if(isset($_GET['id'])) $id = urldecode($_GET['id']);
 
    if(isset($_POST['bouton_submit']) && !empty($_POST['nbre'])){
		//$cat = strip_tags(trim($_POST['cat'])); 
  for($i = 1; $i <= $_POST['nbre']; $i++){
	      if (empty($code)) {
		$msg="<font color=red>Verifier que le code est bien dans le champs!!!!!!!!!</font>";
	}
	else {
		// on regarde si l'url existe déjà 
    $sql = "SELECT * FROM etat_taxation WHERE code='$code'"; 
    $req = mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());  
 
    // on compte le nombre de résultats 
    $res = mysql_num_rows($req); 
 
      if($res!=0)  // l'url existe déjà, on affiche un message d'erreur 
        { 
             $msg = 'Désolé, mais cette Code  existe déjà dans notre base.'; 
             echo '<script>alert(\' '.$msg.' \');</script>' ;
        } 
     else  // L'url n'existe pas, on insère les informations du formulaire dans la table 
        { 
	      $date_impos = mysql_real_escape_string(htmlentities(trim($_POST['date_impos'.$i])));
		  $noms =  mysql_real_escape_string(htmlentities(trim($_POST['noms'.$i])));
		  $ncc =  mysql_real_escape_string(htmlentities(trim($_POST['ncc'.$i])));
		  $ref_facture =  mysql_real_escape_string(htmlentities(trim($_POST['ref_facture'.$i])));
		  $natur_bien =  mysql_real_escape_string(htmlentities(trim($_POST['natur_bien'.$i])));
		  $montant_total =  mysql_real_escape_string(htmlentities(trim($_POST['montant_total'.$i])));
		  $mont_tax_deduct = mysql_real_escape_string(htmlentities(trim($_POST['mont_tax_deduct'.$i])));
		  $code =  mysql_real_escape_string(htmlentities(trim($_POST['code'])));
 
creer_etat_taxation($date_impos,$noms,$ncc,$ref_facture,$natur_bien,$montant_total,$mont_tax_deduct,$code,$id);	
}}}}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
<link rel="stylesheet" href="css/style_f.css" />
</head>
 
<body>
<div style="background-color: #FFFFFF; width: 960px; height: 1500px; position: absolute; top: 17px; left: 16px; z-index: -2000">
<div style="position: absolute; top: 11px; left: 780px"><img src="images/BV.png" width="100" height="50" /></div>
<div  style="text-align: center; background-color: #ccc; width: 500px; left: 201px; position: absolute; top: 25px; z-index: -1000;">ETAT DES TAXATIONS DEDUCTIBLES</div>
<p>&nbsp;</p>
<div style="position:absolute; top:200px; left:25px">
<fieldset style="width: 814px; border-color: #1E1E1E; position: absolute; top: -132px; left: -12px; height: auto;" >
<legend><span class="Style2"> ETAT DES TAXATIONS DEDUCTIBLES</span></legend>
<form class="formulaire" name="form1" method="post" action="">
<table width="312" border="0">
  <tr>
    <td width="121">Saisir le nombre</td>
    <td width="33"><input name="nbre" type="text" size="1" maxlength="1" value="<?php if(isset($_POST['nbre']))echo $_POST['nbre'];?>"/></td>
    <td width="34">&nbsp;</td>
  </tr>
</table>
 
 
  <table width="806" height="162" border="0" bgcolor="#fff align="center">
    <tr>
      <td width="707" colspan="7"><?php if(isset($_POST['bouton_submit']) && ($_POST['nbre'])){ extract($_POST); $nbre_photo = $nbre; for($j = 1; $j<= $nbre_photo; $j++){ 
	  //ENREGISTREMENT DU CODE
	   $sql = ('SELECT (max(code)+1) AS code FROM etat_taxation');
 $q = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
 while($row = mysql_fetch_assoc($q)){ $code = $row["code"];  }
   echo'
   <table width="860" height="45" border="0" bgcolor="#fff align="center="center"">
  <tr>
    <td width="111"><input type="text" name="date_impos'.$j.'" id="date_impos" style="width:80px; text-align:center"" placeholder="Date" /></td>
    <td width="206" height="41"><input type="text" name="noms'.$j.'" id="noms" style="width:150px; text-align:center"" placeholder="Noms"  /></td>
    <td width="85" height="41"><input type="text" name="ncc'.$j.'" style="width:60px" id="ncc" placeholder="NCC" /></td>
    <td width="125" height="41"><input type="text" name="ref_facture'.$j.'" id="ref_facture" style="width:80px" placeholder="Ref"; text-align:center" /></td>
    <td width="118" height="41"><input type="text" name="natur_bien'.$j.'" id="natur_bien" style="width:80px; text-align:center"" placeholder="Nat B." /></td>
    <td width="115"><input type="text" name="montant_total'.$j.'" id="montant_total" style="width:80px; text-align:center"" placeholder="MT" /></td>
    <td width="250" height="41"><input type="text" name="mont_tax_deduct'.$j.'" id="mont_tax_deduct" style="width:80px; text-align:center" placeholder="MTD" /></td>
	<td width="250" height="41"><input type="text" name="code'.$j.'" id="code" value="'.$code.'" style="width:80px;background-color:#E8E8E8; text-align:center"" placeholder="Code" /></td>
  </tr>
</table>
   
   
 ';}
  }
?></td>
    </tr>
  </table>
  <input type="submit" name="bouton_submit" value="envoyer" ></input>
</form>
</fieldset>
 
 
 
<p>&nbsp;</p>
</body>
</html>