Bonjour à tous,

Je fais une mise à jour avec une requette update, mais la requette met à jour toute la table. Je cherche, mais je n'ai pas trouvé l'erreur :

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
    if (!isset($_POST['fil'])) {$_POST['fil']=0 ; }
    if (!isset($_POST['siege'])) {$_POST['siege']=0 ; }
    if (!isset($_POST['info'])) {$_POST['info']=0 ; }
    if (!isset($_POST['mere'])) {$_POST['mere']=0 ; }
    if (!isset($_POST['effst'])) {$_POST['effst']=0 ; }
    if ($_POST['steid'] !='') {
    try
    {
        $sql = 'UPDATE ste SET
            Ste_RS = :rs,
            Ste_Enseigne = :ens,
            Ste_Ville = :ville,
            Ste_CP = :cp,
            Ste_Activite = :act,
            Ste_Status = :sta , 
            ZNE_IdZone = :zone, 
            Ste_Ad1 = :ad1,
            Ste_Ad2 = :ad2,
            Ste_Ad3 = :ad3,
            Ste_Siret = :siret,
            NAF_Id = :naf ;
            Ste_Effectif = :eff, 
            Ste_EffecEstim = :effest,
            Ste_filliale = :fil,
            Ste_Siege = :siege ,
            Ste_PosteEstime = :pes,
            Ste_AnneeCrea = :annee,
            Ste_InfoInterne = :info,
            Ste_KM = :km,
            Ste_IdMere = :mere,
            Ste_CA = :ca,
            Ste_Pays = :pays,
            Ste_Desc = :desc,
            Cef_Lib = :tsa,
            Ste_Site = :web 
            where Ste_Id = :id ;' ; 
 
        $s = $pdo->prepare($sql);
        $s->bindValue(':rs', $_POST['rs'],PDO::PARAM_INT);
        $s->bindValue(':ens', $_POST['enseigne'],PDO::PARAM_STR);
        $s->bindValue(':ville', $_POST['ville'],PDO::PARAM_STR);
        $s->bindValue(':cp', $_POST['cp'],PDO::PARAM_INT);
        $s->bindValue(':act', $_POST['activite'],PDO::PARAM_STR);
        $s->bindValue(':sta', $_POST['status'],PDO::PARAM_STR);
        $s->bindValue(':zone', $_POST['zone'],PDO::PARAM_STR);
        $s->bindValue(':ad1', $_POST['ad1'],PDO::PARAM_STR);
        $s->bindValue(':ad2', $_POST['ad2'],PDO::PARAM_STR);
        $s->bindValue(':ad3', $_POST['ad3'],PDO::PARAM_STR);
        $s->bindValue(':siret', $_POST['siret'],PDO::PARAM_STR);
        $s->bindValue(':naf', $_POST['naf'],PDO::PARAM_STR);
        $s->bindValue(':eff', $_POST['eff'],PDO::PARAM_INT); 
        $s->bindValue(':effest', $_POST['effst'],PDO::PARAM_INT); 
        $s->bindValue(':fil', $_POST['fil'],PDO::PARAM_INT);
        $s->bindValue(':siege', $_POST['siege'],PDO::PARAM_INT); 
        $s->bindValue(':pes', $_POST['pes'],PDO::PARAM_INT);
        $s->bindValue(':annee', $_POST['annee'],PDO::PARAM_INT);
        $s->bindValue(':info', $_POST['info'],PDO::PARAM_INT);
        $s->bindValue(':km', $_POST['km'],PDO::PARAM_INT);
        $s->bindValue(':mere', $_POST['mere'],PDO::PARAM_INT);
        $s->bindValue(':ca', $_POST['ca'],PDO::PARAM_INT);
        $s->bindValue(':pays', $_POST['pays'],PDO::PARAM_STR);
        $s->bindValue(':desc', $_POST['desc'],PDO::PARAM_STR);
        $s->bindValue(':tsa', $_POST['tsa'],PDO::PARAM_STR);
        $s->bindValue(':web', $_POST['web'],PDO::PARAM_STR); 
        $s->bindValue(':id', $_POST['steid'],PDO::PARAM_INT);
 
        $s->execute();
/*        $result = $s->fetchall();
        print_r($result); */
        print_r($_POST);
        $s->closeCursor();
Pour info, le contenu de $_POST :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Array ( [rs] => 1Alpha & eo [id] => [cle] => [siret] => 123456 [enseigne] => sans [activite] => inconnu [naf] => 0000z [status] => RAF [web] => [eff] => 0 [annee] => 0 [ca] => 0.000 [tsa] => 0 salarie [km] => 0 [pes] => [effest] => [ad1] => 1 [ad2] => 2 [ad3] => 3 [cp] => 73000 [ville] => chambe [pays] => [zone] => inconnu [tel] => 04 76 32 21 68 [fax] => 04 76 37 48 67 [email] => [telid] => 28624 [faxid] => 28625 [mailid] => [telold] => 04 76 32 21 68 [faxold] => 04 76 37 48 67 [mailold] => [desc] => [steid] => 12032 [action] => editste [fil] => 0 [siege] => 0 [info] => 0 [mere] => 0 [effst] => 0 )
merci pour votre aide
Tornade