Example #1
0
 static function findAll($dbh)
 {
     $stmt = $dbh->prepare("select * from " . self::$tableName);
     $stmt->execute();
     $result = array();
     while ($row = $stmt->fetch()) {
         $in = new self();
         $in->copyFromRow($row);
         $result[] = $in;
     }
     return $result;
 }
 static function findNewComments($time, $dbh)
 {
     $stmt = $dbh->prepare("select * from " . self::$tableName . " where create_time > :time");
     $stmt->bindParam(":time", $time);
     $stmt->execute();
     $result = array();
     while ($row = $stmt->fetch()) {
         $com = new self();
         $com->copyFromRow($row);
         $result[] = $com;
     }
     return $result;
 }