ben voilà, g une table societe et je veux pouvoir mettre à jour cette table au cas ou des informations sur une societe changeré voici mon code :
<?php
include "connexion.php";
// Traitement des variables POST
$nom=$_POST['nom'];
$update=$_POST['update'];
$contenu=htmlentities($_POST['contenu']);
// Gestion de l'update de la table societe
if($update='nom') {
$query="update tbl_societe SET nom_societe='$contenu' where nom_societe='$nom'";
}
elseif($update='dirigeant') {
$query="update tbl_societe SET dirigeant_societe='$contenu' where nom_societe='$nom'";
}
elseif($update='fax') {
$query="update tbl_societe SET fax_societe='$contenu' where nom_societe='$nom'";
}
?>
<?php
include "connexion.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Gestion des Societes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
Selectionnez la societe puis le champ que vous désirez mettre à jour
<form method="post" action="update_societe.php">
<select name="nom">Choix :
<option selected value="societe"> ---------- Séléction ----------
<?php
$sql="select nom_societe from tbl_societe order by nom_societe";
$req=mysql_query($sql);
while($row = mysql_fetch_row($req)) {
print "\t\t<option>".substr($row[0],0,80)."\n";
}
?>
</select>
<FORM NAME="Choix">
<SELECT NAME="update" >
<OPTION VALUE="">---------- Séléction ----------
<OPTION VALUE="nom">Nom
<OPTION VALUE="dirigeant">Dirigeant
<OPTION VALUE="fax">Fax
<OPTION VALUE="adresse">Adresse
<OPTION VALUE="telephone">Téléphone
<OPTION VALUE="web">Site Internet
<OPTION VALUE="courriel">Adresse Courriel
<OPTION VALUE="creation">Date création
<OPTION VALUE="activite">Activite
<OPTION VALUE="effectif">Effectif
</SELECT>
Nouveau contenu : ,
----
</form>
</html>
et le pb c ke y a ne ce met à jour dans ma table !!! je comprend pas pkoi !! si qq vois merci !! :)