public function retour_profil() { $id = intval($_SESSION['id']); $requete = $this->_db->prepare('select u.name, u.first_name ,p.ville, p.pays, p.profession, p.telephone, p.img from utilisateur u inner join profil p ON p.id=u.id where u.id=:id and p.active=:active'); $requete->execute(array(':id' => $id, ':active' => self::$active)); $result = $requete->fetch(PDO::FETCH_ASSOC); if ($result != null) { $monNouveauProfil = new Profil(); $monNouveauProfil->setVille($result['ville']); $monNouveauProfil->setPays($result['pays']); $monNouveauProfil->setProfession($result['profession']); $monNouveauProfil->setTelephone($result['telephone']); $monNouveauProfil->setImg($result['img']); return $monNouveauProfil; } else { return false; } }