コード例 #1
0
ファイル: DirectorDAO.php プロジェクト: MarieYu/tp_mvc
 public function find($id)
 {
     $id = (int) $id;
     $dir = false;
     $stmt = $this->pdo->prepare("SELECT realisateur_id, nom_realisateur FROM realisateur WHERE realisateur_id=?;");
     $stmt->bindValue(1, $id);
     $stmt->execute();
     $res = $stmt->fetch(PDO::FETCH_ASSOC);
     if ($res) {
         $dir = new DirectorDTO();
         $dir->hydrateSQL($res);
     }
     return $dir;
 }