La requete modification avec update

Bonjour,
j'ai réussi a faire 2 requête juste d'insertion et de sélection mai j'ai un problème dans la requête modification pourtant son affichage est juste mais ion je verifie la base aucun changement n'est fait voici les codes veuillez m'aider c urgent car si mon nest accomplie jaurai pas mon attestaion de stage merci

/page connexion.php/
<?php
$host="localhost";
$user="root";
$db="personne";
$password="";
mysql_connect($host,$user,$password);
mysql_select_db("$db");
?>

/page mofication.php/

<!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=iso-8859-1" />
<title>bonjour</title>

<script language="alerte" type="text/javascript">
function verif(){
if ((document.form.login.value =="")||(document.form.password.value =="")){
alert ("Il faut remplir tous les champs.");
return false;}
else
{return true;}
}
</script>
<!--<link rel="stylesheet" type="text/css" href="style.css" />--!>

<style type="text/css">
<!--
.Style1 {color: #FFFFFF}
.Style2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-style: italic;
}
.Style3 {
font-family: Geneva, Arial, Helvetica, sans-serif, "Adobe Garamond Pro", "Adobe Caslon Pro Bold", "Adobe Caslon Pro"
}
.Style6 {color: #999999; }
-->
</style>
<style type="text/css">
<!--
.Style1 {font-family: Georgia, "Times New Roman", Times, serif}
.Style2 {color: #FFFFFF}
.Style3 {
font-family: Geneva, Arial, Helvetica, sans-serif, "Adobe Garamond Pro", "Adobe Caslon Pro Bold", "Adobe Caslon Pro";
font-weight: bold;
font-style: italic;
font-size: 14px;
}
.Style5 {
font-size: 24px;
color: #FFFFFF;
font-family: Geneva, Arial, Helvetica, sans-serif, "Adobe Garamond Pro", "Adobe Caslon Pro Bold", "Adobe Caslon Pro";
font-weight: bold;
font-style: italic;
}
.Style6 {font-family: Geneva, Arial, Helvetica, sans-serif, "Adobe Garamond Pro", "Adobe Caslon Pro Bold", "Adobe Caslon Pro"}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: underline;
color: #FFFFFF;
}
a:active {
text-decoration: none;
color: #FFFFFF;
}
.Style7 {font-size: 18px;
color: #FFFFFF;
font-family: Geneva, Arial, Helvetica, sans-serif, "Adobe Garamond Pro", "Adobe Caslon Pro Bold", "Adobe Caslon Pro";
font-weight: bold;
font-style: italic;
}
.Style10 {
font-size: 14px;
color: #FFFFFF;
font-family: Geneva, Arial, Helvetica, sans-serif, "Adobe Garamond Pro", "Adobe Caslon Pro Bold", "Adobe Caslon Pro";
font-weight: bold;
font-style: italic;
}
.Style8 {font-style: italic; color: #FFFFFF; font-size: 18px;}
-->
</style>
</head>

<body>
<div align="center">
<form name="form" method="post" action="requetemodification.php" onclick="return verif()">
<table width="1024" height="609" border="1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr background="image.jpg">
<td height="90" colspan="2" nowrap="nowrap"><div align="right"><img src="image.jpg" width="800" height="88" /></div></td>
</tr>
<tr background="1.jpg">
<td height="37" colspan="2" nowrap="nowrap" class="menu"><div align="center" class="Style1">
<div align="center" class="Style2">
<div align="right" class="Style2 Style3">
HOME | PRESENTATION | OPERATION | NOS CONTACTS | SONDAGE | LIENS UTILES</div>
</div>
</div></td>
</tr>
<tr background="2.jpg">
<td width="147" height="478px" rowspan="2" nowrap="nowrap" class="bar"><img src="2.jpg" width="147" height="478" /></td>
<td width="871" height="445" nowrap="nowrap" class="contenu"><div align="center" class="Style6">
<p class="Style8">VOICI UN FORMULAIRE POUR MODIFIER VOTRE LOGIN OU MOT DE PASSE</p>
<p class="Style8"> </p>
<p class="Style8">LOGIN
<input type="text" name="login" value=""/>
<p class="Style8">MOT DE PASSE
<input type="password" name="password" value=""/>
<p class="Style8">CONFIRMER
<input type="password" name="confirm" value=""/>
<p class="Style8">nv login
<input type="text" name="login2" value=""/>
<p class="Style8">nv pass
<input type="password" name="password2" value=""/>

<label>
<br />
nv confirm
<input type="password" name="confirm2" value=""/>
<br />
<input type="submit" name="VALIDER" value="VALIDER" />
<br />
</label>

<label> </label>
<p class="Style7"> </p>
<p class="Style5"> </p>
</div></td>
</tr>
<tr>
<td height="20" colspan="2" nowrap="nowrap" background="4.jpg" class="footer">
<div align="right"><span class="Style10"> NOS CONTACTS | SONDAGE | LIENS UTILES</span> </div></td>
</tr>
</table>
</form>

</div>
</body>
</html>

/requetemodification.php/

<?php

include("connexion.php");?>

<?php
$ancloge=$_POST["login"];
$ancpasse=$_POST["password"];
$ancpasse1=$_POST["confirm"];
$nvcloge=$_POST["login2"];
$nvcpasse=$_POST["password2"];
$nvcpasse1=$_POST["confirm2"];

$sql ="UPDATE identification SET
login=['.$nvcloge.'] ,mot de passe=[.'$nvcpasse'.] ,confirmation=[.'$nvcpasse1.']

WHERE

login='.$ancloge.' AND mot de passe='.$ancpasse.' AND confirmation='.$ancpasse1.'";

$req = @mysql_query($sql);
$data = @mysql_fetch_array($req);

echo "modif cava";

?>
Configuration: Windows XP
Safari 532.0

5 réponses

  1. Contributeur
    Tu as des espaces dans tes noms de champs ? Il faut les retirer, c'est tout sauf recommandé.

    1. nn c pas une question d'espace car les requetes marche bien en tt ka merci
      1. qui peu m aideer c urgennttttttttttttttttttttttttttttttttttttttttttttttttttttttttt svp
        1. /requetemodification.php/

          <?php

          include("connexion.php");?>

          <?php
          $ancloge=$_POST["login"];
          $ancpasse=$_POST["password"];
          $ancpasse1=$_POST["confirm"];
          $nvcloge=$_POST["login2"];
          $nvcpasse=$_POST["password2"];
          $nvcpasse1=$_POST["confirm2"];

          $sql ="UPDATE identification SET
          login='$nvcloge' ,mot de passe='$nvcpasse' ,confirmation='$nvcpasse1'

          WHERE

          login='$ancloge' AND mot de passe='$ancpasse' AND confirmation='$ancpasse1'";

          $req = @mysql_query($sql);
          $data = @mysql_fetch_array($req);

          echo "modif cava";

          ?> urgeenttttttttttttttttttttttttttttttttttttttttttttttttt