IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

update+insert, update ok insert ne fonctionne pas [MySQL]


Sujet :

PHP & Base de données

  1. #1
    Membre régulier
    Femme Profil pro
    Webdesigner
    Inscrit en
    Juin 2014
    Messages
    176
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 37
    Localisation : Belgique

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Juin 2014
    Messages : 176
    Points : 74
    Points
    74
    Par défaut update+insert, update ok insert ne fonctionne pas
    bonjour à tous...
    j'ai un petit soucis, j'ai un formulaire(évidement).
    dans ce formulaire j'ai en action="Modification_profil.php".
    dans Modification_profil.php:
    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
    ....
    try {
            $valid->assert($objet);
            $st = $bdd->prepare('UPDATE membres SET nom=:nom, prenom=:prenom, email=:email, postale=:postale, ville=:ville, pass=:pass WHERE identifiant=:identifiant ');
            $st->execute([':nom' => $objet->nom, ':prenom' => $objet->prenom, ':email' => $objet->email, ':postale' => $objet->postale, ':ville' => $objet->ville, ':pass' => $objet->pass, ':identifiant' => $objet->identifiant]);
     
            //$st = $bdd->prepare("INSERT INTO membres_info_compl (relation, recherche, taille, poid, fumeur, comment) VALUES (?,?,?,?,?,?,?) WHERE identifiant= ?");
            //$st->execute(array($objet->relation, $objet->recherche, $objet->taille, $objet->poid,$objet->fumeur, $objet->comment, $objet->identifiant));
     
            $_SESSION['data'] = $_POST;
     
            header('location:accueil.php');
     
        }
    ...
    j'ai laissé les //, car mon code fonctionne très bien avec le update mais par contre ne fonctionne pas avec le insert je ne comprend pas pourquoi alors que mes données sont correcte...
    est-ce que mon code est mal écris?
    merci pour vos idées

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Enlève la clause WHERE et active les erreurs PDO.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre régulier
    Femme Profil pro
    Webdesigner
    Inscrit en
    Juin 2014
    Messages
    176
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 37
    Localisation : Belgique

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Juin 2014
    Messages : 176
    Points : 74
    Points
    74
    Par défaut
    j'ai enlevé le WHERE dans le insert.
    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
    try {
            $valid->assert($objet);
            $st = $bdd->prepare('UPDATE membres SET nom=:nom, prenom=:prenom, email=:email, postale=:postale, ville=:ville, pass=:pass WHERE identifiant=:identifiant ');
            $st->execute([':nom' => $objet->nom, ':prenom' => $objet->prenom, ':email' => $objet->email, ':postale' => $objet->postale, ':ville' => $objet->ville, ':pass' => $objet->pass, ':identifiant' => $objet->identifiant]);
     
            $st = $bdd->prepare("INSERT INTO membres_info_compl (relation, recherche, taille, poid, fumeur, comment) VALUES (?,?,?,?,?,?,?) ");
            $st->execute(array($objet->relation, $objet->recherche, $objet->taille, $objet->poid,$objet->fumeur, $objet->comment));
     
            $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    //        $_SESSION['data'] = $_POST;
    //
    //        header('location:accueil.php');
    //
        } catch (\InvalidArgumentException $e) {
     
                $objet->error = $e->findMessages([
                    'notEmpty' => '{{name}} veuillez remplir ce champ'
                    , 'alnum' => '{{name}} Que des chiffres et des lettres',
                    'email' => ' Votre email est incorrecte',
                    'alpha' => '{{name}} ne peut contenir que des lettres',
                    'numeric' => '{{name}} que des chiffres',
    //
    //
               ]);
    mais ca ne m'affiche rien

  4. #4
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    ça me paraissait évident mais il faut activer les erreurs avant de faire la requête.
    L'exception PDO ne tombera pas dans ton catch de toute façon.

    De plus tu as $db au lieu de $bdd ; ca serait bien que tu actives les erreurs PHP quand tu debugues.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  5. #5
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 496
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 496
    Points : 12 596
    Points
    12 596
    Par défaut
    tu as 7 éléments :

    Alors que tu en attends 6

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    (relation, recherche, taille, poid, fumeur, comment)

  6. #6
    Membre régulier
    Femme Profil pro
    Webdesigner
    Inscrit en
    Juin 2014
    Messages
    176
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 37
    Localisation : Belgique

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Juin 2014
    Messages : 176
    Points : 74
    Points
    74
    Par défaut correction
    donc sabotage tu me demandais de faire ceci?
    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
    if (isset($_POST)) {
        $objet = new stdClass();
     
     
        $objet->nom = $_POST["nom"];
        $objet->prenom = $_POST["prenom"];
        $objet->email = $_POST["email"];
        $objet->postale = $_POST["postale"];
        $objet->ville = $_POST["ville"];
        $objet->identifiant = $_POST["identifiant"];
        $objet->pass = $_POST["pass"];
        $objet->relation = $_POST["relation"];
        $objet->recherche = $_POST["recherche"];
        $objet->taille = $_POST["taille"];
        $objet->poid = $_POST["poid"];
        $objet->fumeur = $_POST["fumeur"];
        $objet->comment = $_POST["comment"];
     
     
        $valid = v::attribute('email', v::email()->notEmpty()->setName('Email'))
            ->attribute('postale', v::numeric()->notEmpty()->setName('Postale'))
            ->attribute('ville', v::alpha()->notEmpty()->setName('Ville'))
            ->attribute('identifiant', v::alnum()->notEmpty()->setName('Identifiant'))
            ->attribute('pass', v::alnum()->notEmpty()->setName('Pass'))
            ->attribute('relation', v::numeric()->notEmpty()->setName('relation'))
            ->attribute('recherche', v::numeric()->notEmpty()->setName('recherche'))
            ->attribute('taille', v::numeric()->notEmpty()->setName('taille'))
            ->attribute('poid', v::numeric()->notEmpty()->setName('poid'))
            ->attribute('fumeur', v::numeric()->notEmpty()->setName('fumeur'))
            ->attribute('comment', v::alnum()->notEmpty()->setName('comment'));
     
     
        echo $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        echo error_reporting( E_ALL );
        try {
            $valid->assert($objet);
            $st = $bdd->prepare('UPDATE membres SET nom=:nom, prenom=:prenom, email=:email, postale=:postale, ville=:ville, pass=:pass WHERE identifiant=:identifiant ');
            $st->execute([':nom' => $objet->nom, ':prenom' => $objet->prenom, ':email' => $objet->email, ':postale' => $objet->postale, ':ville' => $objet->ville, ':pass' => $objet->pass, ':identifiant' => $objet->identifiant]);
     
            $st = $bdd->prepare("INSERT INTO membres_info_compl (relation, recherche, taille, poid, fumeur, comment) VALUES (?,?,?,?,?,?) ");
            $st->execute(array($objet->relation, $objet->recherche, $objet->taille, $objet->poid,$objet->fumeur, $objet->comment));
    j'ai ceci qui s'est marqué: 132759

    maitrepylos, j'ai corrigé avec les ?, mais cela n'avait rien changé

  7. #7
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Comme je t'ai dit ton try/catch va intercepter les exceptions PDO donc tu ne les verras pas.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  8. #8
    Membre régulier
    Femme Profil pro
    Webdesigner
    Inscrit en
    Juin 2014
    Messages
    176
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 37
    Localisation : Belgique

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Juin 2014
    Messages : 176
    Points : 74
    Points
    74
    Par défaut
    voilà j'ai fais ceci:

    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
    72
    73
    74
    75
    76
    <?php
    session_start();
     
    include "db.php";
    include "Validation/vendor/autoload.php";
    use Respect\Validation\Validator as v;
     
    if (isset($_POST)) {
        $objet = new stdClass();
     
     
        $objet->nom = $_POST["nom"];
        $objet->prenom = $_POST["prenom"];
        $objet->email = $_POST["email"];
        $objet->postale = $_POST["postale"];
        $objet->ville = $_POST["ville"];
        $objet->identifiant = $_POST["identifiant"];
        $objet->pass = $_POST["pass"];
        $objet->relation = $_POST["relation"];
        $objet->recherche = $_POST["recherche"];
        $objet->taille = $_POST["taille"];
        $objet->poid = $_POST["poid"];
        $objet->fumeur = $_POST["fumeur"];
        $objet->comment = $_POST["comment"];
     
     
        $valid = v::attribute('email', v::email()->notEmpty()->setName('Email'))
            ->attribute('postale', v::numeric()->notEmpty()->setName('Postale'))
            ->attribute('ville', v::alpha()->notEmpty()->setName('Ville'))
            ->attribute('identifiant', v::alnum()->notEmpty()->setName('Identifiant'))
            ->attribute('pass', v::alnum()->notEmpty()->setName('Pass'))
            ->attribute('relation', v::numeric()->notEmpty()->setName('relation'))
            ->attribute('recherche', v::numeric()->notEmpty()->setName('recherche'))
            ->attribute('taille', v::numeric()->notEmpty()->setName('taille'))
            ->attribute('poid', v::numeric()->notEmpty()->setName('poid'))
            ->attribute('fumeur', v::numeric()->notEmpty()->setName('fumeur'))
            ->attribute('comment', v::alnum()->notEmpty()->setName('comment'));
     
        echo $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        echo error_reporting( E_ALL );
    //    try {
    //        $valid->assert($objet);
    //        $st = $bdd->prepare('UPDATE membres SET nom=:nom, prenom=:prenom, email=:email, postale=:postale, ville=:ville, pass=:pass WHERE identifiant=:identifiant ');
    //        $st->execute([':nom' => $objet->nom, ':prenom' => $objet->prenom, ':email' => $objet->email, ':postale' => $objet->postale, ':ville' => $objet->ville, ':pass' => $objet->pass, ':identifiant' => $objet->identifiant]);
    //
    //        $st = $bdd->prepare("INSERT INTO membres_info_compl (relation, recherche, taille, poid, fumeur, comment) VALUES (?,?,?,?,?,?) ");
    //        $st->execute(array($objet->relation, $objet->recherche, $objet->taille, $objet->poid,$objet->fumeur, $objet->comment));
    //
    //
    //
    ////        $_SESSION['data'] = $_POST;
    ////
    ////        header('location:accueil.php');
    ////
    //    } catch (\InvalidArgumentException $e) {
    //
    //            $objet->error = $e->findMessages([
    //                'notEmpty' => '{{name}} veuillez remplir ce champ'
    //                , 'alnum' => '{{name}} Que des chiffres et des lettres',
    //                'email' => ' Votre email est incorrecte',
    //                'alpha' => '{{name}} ne peut contenir que des lettres',
    //                'numeric' => '{{name}} que des chiffres',
    //
    //
    //           ]);
    ////            $_SESSION['error'] = $objet->error;
    ////        $_SESSION['data'] = $_POST;
    ////
    ////            //header('location:Mon_profil.php');
    //    }
     
     
    }
     
     
    ?>


    mais toujours : 132759

  9. #9
    Membre régulier
    Femme Profil pro
    Webdesigner
    Inscrit en
    Juin 2014
    Messages
    176
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 37
    Localisation : Belgique

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Juin 2014
    Messages : 176
    Points : 74
    Points
    74
    Par défaut
    j'ai également fait un var_dump:
    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
    72
    73
    74
    75
    76
    77
    <?php
    session_start();
     
    include "db.php";
    include "Validation/vendor/autoload.php";
    use Respect\Validation\Validator as v;
     
    if (isset($_POST)) {
        $objet = new stdClass();
     
     
        $objet->nom = $_POST["nom"];
        $objet->prenom = $_POST["prenom"];
        $objet->email = $_POST["email"];
        $objet->postale = $_POST["postale"];
        $objet->ville = $_POST["ville"];
        $objet->identifiant = $_POST["identifiant"];
        $objet->pass = $_POST["pass"];
        $objet->relation = $_POST["relation"];
        $objet->recherche = $_POST["recherche"];
        $objet->taille = $_POST["taille"];
        $objet->poid = $_POST["poid"];
        $objet->fumeur = $_POST["fumeur"];
        $objet->comment = $_POST["comment"];
     
     
        $valid = v::attribute('email', v::email()->notEmpty()->setName('Email'))
            ->attribute('postale', v::numeric()->notEmpty()->setName('Postale'))
            ->attribute('ville', v::alpha()->notEmpty()->setName('Ville'))
            ->attribute('identifiant', v::alnum()->notEmpty()->setName('Identifiant'))
            ->attribute('pass', v::alnum()->notEmpty()->setName('Pass'))
            ->attribute('relation', v::numeric()->notEmpty()->setName('relation'))
            ->attribute('recherche', v::numeric()->notEmpty()->setName('recherche'))
            ->attribute('taille', v::numeric()->notEmpty()->setName('taille'))
            ->attribute('poid', v::numeric()->notEmpty()->setName('poid'))
            ->attribute('fumeur', v::numeric()->notEmpty()->setName('fumeur'))
            ->attribute('comment', v::alnum()->notEmpty()->setName('comment'));
     
        echo $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        echo error_reporting( E_ALL );
        var_dump($valid, $objet);
    //    try {
    //        $valid->assert($objet);
    //        $st = $bdd->prepare('UPDATE membres SET nom=:nom, prenom=:prenom, email=:email, postale=:postale, ville=:ville, pass=:pass WHERE identifiant=:identifiant ');
    //        $st->execute([':nom' => $objet->nom, ':prenom' => $objet->prenom, ':email' => $objet->email, ':postale' => $objet->postale, ':ville' => $objet->ville, ':pass' => $objet->pass, ':identifiant' => $objet->identifiant]);
    //
    //        $st = $bdd->prepare("INSERT INTO membres_info_compl (relation, recherche, taille, poid, fumeur, comment) VALUES (?,?,?,?,?,?) ");
    //        $st->execute(array($objet->relation, $objet->recherche, $objet->taille, $objet->poid,$objet->fumeur, $objet->comment));
    //
    //
    //
    ////        $_SESSION['data'] = $_POST;
    ////
    ////        header('location:accueil.php');
    ////
    //    } catch (\InvalidArgumentException $e) {
    //
    //            $objet->error = $e->findMessages([
    //                'notEmpty' => '{{name}} veuillez remplir ce champ'
    //                , 'alnum' => '{{name}} Que des chiffres et des lettres',
    //                'email' => ' Votre email est incorrecte',
    //                'alpha' => '{{name}} ne peut contenir que des lettres',
    //                'numeric' => '{{name}} que des chiffres',
    //
    //
    //           ]);
    ////            $_SESSION['error'] = $objet->error;
    ////        $_SESSION['data'] = $_POST;
    ////
    ////            //header('location:Mon_profil.php');
    //    }
     
     
    }
     
     
    ?>
    la réponse:
    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
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    132759
    object(Respect\Validation\Validator)[5]
      protected 'rules' => 
        array (size=11)
          '000000001b3aa1030000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[9]
              public 'mandatory' => boolean true
              public 'reference' => string 'email' (length=5)
              public 'validator' => 
                object(Respect\Validation\Validator)[4]
                  ...
              protected 'name' => string 'email' (length=5)
              protected 'template' => null
          '000000001b3aa1070000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[13]
              public 'mandatory' => boolean true
              public 'reference' => string 'postale' (length=7)
              public 'validator' => 
                object(Respect\Validation\Validator)[8]
                  ...
              protected 'name' => string 'postale' (length=7)
              protected 'template' => null
          '000000001b3aa11b0000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[17]
              public 'mandatory' => boolean true
              public 'reference' => string 'ville' (length=5)
              public 'validator' => 
                object(Respect\Validation\Validator)[10]
                  ...
              protected 'name' => string 'ville' (length=5)
              protected 'template' => null
          '000000001b3aa11f0000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[21]
              public 'mandatory' => boolean true
              public 'reference' => string 'identifiant' (length=11)
              public 'validator' => 
                object(Respect\Validation\Validator)[14]
                  ...
              protected 'name' => string 'identifiant' (length=11)
              protected 'template' => null
          '000000001b3aa1130000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[25]
              public 'mandatory' => boolean true
              public 'reference' => string 'pass' (length=4)
              public 'validator' => 
                object(Respect\Validation\Validator)[18]
                  ...
              protected 'name' => string 'pass' (length=4)
              protected 'template' => null
          '000000001b3aa1170000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[29]
              public 'mandatory' => boolean true
              public 'reference' => string 'relation' (length=8)
              public 'validator' => 
                object(Respect\Validation\Validator)[22]
                  ...
              protected 'name' => string 'relation' (length=8)
              protected 'template' => null
          '000000001b3aa12b0000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[33]
              public 'mandatory' => boolean true
              public 'reference' => string 'recherche' (length=9)
              public 'validator' => 
                object(Respect\Validation\Validator)[26]
                  ...
              protected 'name' => string 'recherche' (length=9)
              protected 'template' => null
          '000000001b3aa12f0000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[37]
              public 'mandatory' => boolean true
              public 'reference' => string 'taille' (length=6)
              public 'validator' => 
                object(Respect\Validation\Validator)[30]
                  ...
              protected 'name' => string 'taille' (length=6)
              protected 'template' => null
          '000000001b3aa1230000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[41]
              public 'mandatory' => boolean true
              public 'reference' => string 'poid' (length=4)
              public 'validator' => 
                object(Respect\Validation\Validator)[34]
                  ...
              protected 'name' => string 'poid' (length=4)
              protected 'template' => null
          '000000001b3aa1270000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[45]
              public 'mandatory' => boolean true
              public 'reference' => string 'fumeur' (length=6)
              public 'validator' => 
                object(Respect\Validation\Validator)[38]
                  ...
              protected 'name' => string 'fumeur' (length=6)
              protected 'template' => null
          '000000001b3aa13b0000000014500eac' => 
            object(Respect\Validation\Rules\Attribute)[49]
              public 'mandatory' => boolean true
              public 'reference' => string 'comment' (length=7)
              public 'validator' => 
                object(Respect\Validation\Validator)[42]
                  ...
              protected 'name' => string 'comment' (length=7)
              protected 'template' => null
      protected 'name' => null
      protected 'template' => null
    object(stdClass)[3]
      public 'nom' => string 'xxx' (length=7)
      public 'prenom' => string 'xxxx' (length=9)
      public 'email' => string 'xxxx' (length=25)
      public 'postale' => string 'xxx' (length=4)
      public 'ville' => string 'comblain ' (length=16)
      public 'identifiant' => string 'crijxxx' (length=6)
      public 'pass' => string 'xxx' (length=8)
      public 'relation' => string '3' (length=1)
      public 'recherche' => string '3' (length=1)
      public 'taille' => null
      public 'poid' => null
      public 'fumeur' => string '1' (length=1)
      public 'comment' => string 'rien' (length=4)

  10. #10
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     echo error_reporting( E_ALL );
    Le echo n'a rien a faire ici.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  11. #11
    Membre régulier
    Femme Profil pro
    Webdesigner
    Inscrit en
    Juin 2014
    Messages
    176
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 37
    Localisation : Belgique

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Juin 2014
    Messages : 176
    Points : 74
    Points
    74
    Par défaut
    j'ai enlevé l'echo que tu me disais.
    et avec le :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    echo $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    j'obtien: 1.
    puis ensuite le var_dump ca ne change pas ce que j'ai obtenu dans mon précédent message

  12. #12
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    arrete de mettre des echo partout.
    ce echo n'a rien à faire la non plus.
    ton var_dump() ne sert pas a grand chose non plus.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 1
    Dernier message: 18/03/2014, 14h31
  2. insertion de javascript qui ne fonctionne pas
    Par flamant dans le forum Langage
    Réponses: 8
    Dernier message: 12/02/2012, 00h09
  3. [MySQL] insertion et update qui ne fonctionnent pas
    Par nox77 dans le forum PHP & Base de données
    Réponses: 8
    Dernier message: 24/06/2010, 13h27
  4. [MySQL] INSERT et UPDATE qui ne fonctionnent pas
    Par philippef dans le forum PHP & Base de données
    Réponses: 3
    Dernier message: 09/07/2008, 12h53
  5. Insertion avec contraintes qui ne fonctionnent pas
    Par max44410 dans le forum Requêtes
    Réponses: 4
    Dernier message: 08/01/2008, 23h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo