probleme de requete et variable indefinies.
Posté : 04 mai 2012, 17:57
Bonjour à tous, j'ai ce code-ci:
otice: Undefined index: libelle in C:\wamp\www\NEOGETCASH\GESTIONNAIRE\edit-decompte2.php on line 730
Call Stack
# Time Memory Function Location
1 0.0644 843328 {main}( ) ..\edit-decompte2.php:0
" /> ( ! ) Notice: Undefined index: montant in C:\wamp\www\NEOGETCASH\GESTIONNAIRE\edit-decompte2.php on line 731
d'avance merci pour votre aide.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250"><img src="images/creance.png" width="250" height="250" /></td>
<td valign="top"><h3>Edition du décompte</h3>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td>LIBELLE</td>
<td>MONTANT</td>
<td>CLIENT</td>
</tr><form action="save-decompte.php" method="post">
<?php
$$sql = "SELECT * FROM liasses where n_doss='".$_GET['n_doss']."'";
$result = mysql_query($sql) or die(__LINE__.mysql_error().$sql);
while ($donnees = mysql_fetch_array($result) ) {
?>
<tr>
<td> <input type="text" name="liasse[libelle][]" value="<?php echo $donnees['libelle'] ; ?>" /></td>
<td><input type="text" name="liasse[montant][]" value="<?php echo $donnees['montant'] ; ?>" /></td>
<td><select name="<?php echo $donnees['client'] ; ?>"><?php if ($donnees['client']=="oui") { ?><option><?php echo $donnees['client'] ; ?></option><option>non</option> <?php } else { ?><option>non</option><option>oui</option> <?php
}
?></select></td>
<?php
}
?></tr>
<input type="hidden" name="n_doss" value="<?php echo $_GET['n_doss'] ?>" />
<input type="hidden" name="code_client" value="<?php echo $_GET['code_client'] ?>" />
<?php
for ($compteur = 1; $compteur <= $_GET['champs']; $compteur++) { echo '<tr><td> <input type="text" name="libelle" ;></td>
<td><input type="text" name="montant" ; ?></td>
<td><select name="client" ; ?><option>oui</option><option>non</option></select></td></tr>' ;}
?> </table>
</td>
</tr>
</table>
le soucis c'est que la requête mysql me renvoit des messages d'erreurs de type undefined va, alors que pourtant les champs existent bien dans mysql,n je ne sais pas d'ou cela provient. voici le type d'erreurs:otice: Undefined index: libelle in C:\wamp\www\NEOGETCASH\GESTIONNAIRE\edit-decompte2.php on line 730
Call Stack
# Time Memory Function Location
1 0.0644 843328 {main}( ) ..\edit-decompte2.php:0
" /> ( ! ) Notice: Undefined index: montant in C:\wamp\www\NEOGETCASH\GESTIONNAIRE\edit-decompte2.php on line 731
d'avance merci pour votre aide.