Bonjour,
J'ai la requête suivante
la MAJ ne se fait pas. Pourtant, ça retourne bien qu'il y a une ligne d'updaté.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 $this-> nouveauPasswordOK = $db->prepare("update scf_licencies set Reinit_mdp = null, Password = :password where idLicencie = :idLicencie"); public function nouveauPasswordOK($idLicencie, $password) { $this -> nouveauPasswordOK -> execute(array(':password' => $password, ':idLicencie' => $idLicencie)); return $this->nouveauPasswordOK->rowCount(); }
Pourquoi ?
Je pense avoir mon idée, mais pas la solution.
En début de script, j'ai un $GLOBALS['bdd']->beginTransaction();
Seulement, quand je veux faire un COMMIT avec $GLOBALS['bdd']->commit();, ça retourne
La connexion à la BD se fait par :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 Dans class_licencie, fonction nouveauPasswordOK. Password : le_mot_de_passe_crypté Nb lignes MAJ : 1 Fatal error: Call to a member function commit() on a non-object in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\projects\SCF\core\pages\licencie_reinit_password.php on line 50
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 $GLOBALS['bdd'] = new PDO("mysql:host=$hostname; dbname=$nom_base_donnees", $user, $password, array(PDO::ATTR_PERSISTENT => true)); $GLOBALS['bdd']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Merci pour votre aide.
Eddy
Partager