예제 #1
0
 /**
  * 更新一条消息数据
  * @param Bigint $messageId
  * @param Array $data
  */
 public function update($messageId, $data)
 {
     $sql = Sql::getUpdate($this->table, $data, 'messageId=:messageId');
     $stmt = $this->pdoInstance->prepare($sql);
     foreach ($data as $field => $v) {
         $stmt->bindParam(':' . $field, $data[$field]);
     }
     return $stmt->execute(array(':messageId' => $messageId));
 }
예제 #2
0
 /**
  * 更新一条消息数据
  * @param Bigint $messageId
  * @param Array $data
  */
 public function update($messageId, $data)
 {
     $pdo = PdoFactory::instance(self::DB_MASTER);
     $sql = Sql::getUpdate($this->table, $data, 'messageId=:messageId');
     $stmt = $pdo->prepare($sql);
     foreach ($data as $field => $v) {
         $stmt->bindParam(':' . $field, $data[$field]);
     }
     return $stmt->execute(array(':messageId' => $messageId));
 }