Beispiel #1
0
 function updateRSS(RSS $rss)
 {
     // Met à jour uniquement le titre et la date
     $titre = $this->db->quote($rss->getTitre());
     $q = "UPDATE RSS SET titre = {$titre}, date='{$rss->getDate()}' WHERE url='{$rss->getUrl()}'";
     $RSS_id = "SELECT id FROM RSS WHERE url = '{$rss->getUrl()}'";
     try {
         $r = $this->db->exec($q);
         $RSS_ids = $this->db->query($RSS_id)->fetch();
         if ($r == 0) {
             die("updateRSS error: no rss updated\n");
         }
     } catch (PDOException $e) {
         die("PDO Error :" . $e->getMessage());
     }
     return $RSS_ids;
 }