par
castelli » 24 juin 2005, 13:10
humm humm
Tout d'abord Van j'affiche mes anciennes valeur dans le formulaire..!
donc pour sa pas de probleme

hihi (desolé de pas l'avoir précisé
<?php
$query="INSERT INTO produit2 (nom,formule,reference,disponibilite,localisation,quantite,numero_cass,toxicite) VALUES ('".$nom."', '".$formule."', '".$reference."', '".$disponibilite."','".$localisation."','".$quantite."','".$numero_cass."','".$toxicite."');";
mysql_query($query) or die (mysql_error);
?>
<tr width="30%" height="15"><td><b>Nom de la molécule :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['nom']; ?></b></td>
<td><b><input type="text" name="nom"></b></td></tr>
<tr width="30%" height="29"><td><b>Formule brute de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['formule']; ?></b></td>
<td><b><input type="text" name="formule"></b></td></tr>
sinon pour la requete update
avant il faut faire
if (empty($nom2)){
$nom2 = $nom1
}else{$nom2 = $nom2}
c'est mieu comme sa??
sinon voila ma requete update
$query="UPDATE table SET nom='$nom2', formule='$formule2', localisation='$localisation2', disponibilite='$disponibilite2', quantite='$quantite', reference='$reference2', numero_cass='$numero_cass2', toxicite='$toxicite2'";
$resultat=mysql_query($query);
C'est bon comme sa

humm humm
Tout d'abord Van j'affiche mes anciennes valeur dans le formulaire..!
donc pour sa pas de probleme :lol: :lol: hihi (desolé de pas l'avoir précisé :wink:
[php]<?php
$query="INSERT INTO produit2 (nom,formule,reference,disponibilite,localisation,quantite,numero_cass,toxicite) VALUES ('".$nom."', '".$formule."', '".$reference."', '".$disponibilite."','".$localisation."','".$quantite."','".$numero_cass."','".$toxicite."');";
mysql_query($query) or die (mysql_error);
?>
<tr width="30%" height="15"><td><b>Nom de la molécule :</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['nom']; ?></b></td>
<td><b><input type="text" name="nom"></b></td></tr>
<tr width="30%" height="29"><td><b>Formule brute de la molecule:</td>
<td><div style="color: #ff0000; text-align: center; font-weight: bold"></div></td>
<td><b><?php print $row['formule']; ?></b></td>
<td><b><input type="text" name="formule"></b></td></tr>
[/php]
sinon pour la requete update
avant il faut faire
[php] if (empty($nom2)){
$nom2 = $nom1
}else{$nom2 = $nom2}[/php]
c'est mieu comme sa??
sinon voila ma requete update
[php]$query="UPDATE table SET nom='$nom2', formule='$formule2', localisation='$localisation2', disponibilite='$disponibilite2', quantite='$quantite', reference='$reference2', numero_cass='$numero_cass2', toxicite='$toxicite2'";
$resultat=mysql_query($query);
[/php]
C'est bon comme sa :? :?