Db::update PHP Méthode

update() public méthode

更新记录
public update ( mixed $data, array $options ) : false | integer
$data mixed 数据
$options array 表达式
Résultat false | integer | integer
    public function update($data, $options)
    {
        $sql = 'UPDATE ' . $this->parseTable($options['table']) . $this->parseSet($data) . $this->parseWhere(isset($options['where']) ? $options['where'] : '') . $this->parseOrder(isset($options['order']) ? $options['order'] : '') . $this->parseLimit(isset($options['limit']) ? $options['limit'] : '') . $this->parseLock(isset($options['lock']) ? $options['lock'] : false);
        return $this->execute($sql);
    }

Usage Example

Exemple #1
0
 public static function unpublish($id)
 {
     $id = Typo::int($id);
     $ins = array('table' => 'posts', 'id' => $id, 'key' => array('status' => '0'));
     $post = Db::update($ins);
     return $post;
 }
All Usage Examples Of Db::update