Update statement.

@param string $table Table name.
@param array $args Dict of what to UPDATE.
@param array $where Dict of WHERE to UPDATE.
967531
final public function update($table, $args, $where=[]) {
		$pair_args = $params = [];
		foreach ($args as $key => $val) {
			$pair_args[] = "{$key}=?";
			$params[] = $val;
		}

		$stmt = sprintf("UPDATE $table SET %s",
			implode(",", $pair_args));

		if ($where) {
			$pair_wheres = [];
			foreach ($where as $key => $val) {
				$pair_wheres[] = "${key}=?";
				$params[] = $val;
			}
			$stmt .= " WHERE ";
			$stmt .= implode(' AND ', $pair_wheres);
		}

		self::$logger->info(sprintf(
			"SQL: update ok: %s <- '%s'.",
			$stmt, json_encode($args)));

		$this->prepare_statement($stmt, $params);
	}
563545
public function createUpdate(string $tableName, array $set, string $where): string
    {
        // 构造更新语句
        return "UPDATE " . $tableName . " SET " . implode(',', $set) . ' ' . $where;
    }
1013622
public function update(string $table = null, array $values = null): Query\Update
    {
        return new Query\Update($table, $values, $this->getConfigKey());
    }
773425
public function ExecuteUpdate($table, $data, $where)
    {
        if (is_object($data))
            ModelState::ModelTreatment($data);

        $data = (array)$data;
        // Ordena
        ksort($data);

        // Define os dados que ser�o atualizados
        $novosDados = NULL;

        foreach ($data as $key => $value) {
            $novosDados .= "`$key`=:$key,";
        }

        $novosDados = rtrim($novosDados, ',');

        // Prepara a Query
        $sth = $this->prepare("UPDATE $table SET $novosDados WHERE $where");

        // Define os dados
        foreach ($data as $key => $value) {
            // Se o tipo do dado for inteiro, usa PDO::PARAM_INT, caso contr�rio, PDO::PARAM_STR
            $tipo = (is_int($value)) ? PDO::PARAM_INT : PDO::PARAM_STR;

            // Define o dado
            $sth->bindValue(":$key", $value, $tipo);
        }

        // Sucesso ou falha?
        return $sth->execute();
    }
526651
public static function delete($table,$where=[])
    {
        $bind=[];
        if(empty($where)){
            $where='';
        }else{
            $w=new Where($where);
            $where=' WHERE '.$w->parseWhere();
            $bind=array_merge($bind,$w->parseBind());
        }
        $sql=sprintf('DELETE FROM `:%s` %s',$table,$where);
        $bind=array_merge($bind,$bind);
        return self::execute($sql,$bind);
    }
290040
public function compileUpdate(string $table, array $updates, array $whereTokens = []): string
    {
        $table = $this->quote($table, true);

        //Preparing update column statement
        $updates = $this->prepareUpdates($updates);

        //Where statement is optional for update queries
        $whereStatement = $this->optional("\nWHERE", $this->compileWhere($whereTokens));

        return rtrim("UPDATE {$table}\nSET {$updates} {$whereStatement}");
    }
139830
public function update(string $from, $wheres, array $values, array $options = [])
    {
        list($where, $bindings) = DBHelper::handleConditions($wheres, $this);

        $options['update'] = $this->qn($from);
        $options['where'] = $where;

        $statement = $this->compileUpdate($values, $bindings, $options);

        if (isset($options['returnSql'])) {
            return [$statement, $bindings];
        }

        return $this->fetchAffected($statement, $bindings);
    }
506969
public static int update(String sql, Object... args) {
		int result = 0;
		Connection con = getconnnection();
		PreparedStatement ps = null;
		try {
			ps = con.prepareStatement(sql);
			if (args != null) {
				for (int i = 0; i < args.length; i++) {
					ps.setObject((i + 1), args[i]);
				}
			}
			result = ps.executeUpdate();
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			close(ps, con);
		}

		return result;
	}
1273729
public function update($table, $values, $conditions, $params = array())
    {
        $updates = array();
        if (!is_array($values)) {
            $values = array($values);
        }
        foreach ($values as $k => $value) {
            if (is_integer($k)) {
                $updates[] = $value;
            } else {
                $updates[] = $this->db->quoteColumn($k) . ' = :__' . $k;
                $params[':__' . $k] = $value;
            }
        }

        $sql = "UPDATE " . $this->db->quoteTable($table) . ' SET ' . implode(', ', $updates);
        $conditions = $this->buildConditions($conditions);
        if ('' === $conditions) {
            throw new Exception('Update condition must not be empty');
        }

        $sql .= ' WHERE ' . $conditions;

        return $this->setSql($sql)->execute($params);
    }
1266342
final public function update( $values, $where ) {
		if ( ! isset( $values[ 'updated' ] ) ) {
			$values['updated'] = current_time( 'mysql', $this->use_gmt() );
		}
		try {
			return $this->db->update( $this->table, $values, $where, $this->get_place_holders( $values ), $this->get_place_holders( $where ) );
		} catch ( \Exception $e ) {
			return false;
		}
	}
572398
def update(table, values, where=(), **kwargs):
    """"""
    where = dict(where, **kwargs).items()
    sql, args = makeSQL("UPDATE", table, values=values, where=where)
    return execute(sql, args).rowcount
197807
public function update($table, $fieldValues, $conditions, $bind = [])
    {
        if (!$fieldValues) {
            throw new InvalidArgumentException(['Unable to update :table table without data', 'table' => $table]);
        }

        if (is_string($conditions)) {
            $conditions = [$conditions];
        }

        $wheres = [];

        /** @noinspection ForeachSourceInspection */
        foreach ($conditions as $k => $v) {
            if (is_int($k)) {
                $wheres[] = stripos($v, ' or ') ? "($v)" : $v;
            } else {
                $wheres[] = "[$k]=:$k";
                $bind[$k] = $v;
            }
        }

        $setFields = [];
        foreach ($fieldValues as $k => $v) {
            if (is_int($k)) {
                $setFields[] = $v;
            } elseif ($v instanceof AssignmentInterface) {
                $v->setFieldName($k);
                $setFields[] = $v->getSql();
                /** @noinspection SlowArrayOperationsInLoopInspection */
                $bind = array_merge($bind, $v->getBind());
            } else {
                $setFields[] = "[$k]=:$k";
                $bind[$k] = $v;
            }
        }

        $sql = 'UPDATE ' . $this->_escapeIdentifier($table) . ' SET ' . implode(',', $setFields) . ' WHERE ' . implode(' AND ', $wheres);

        return $this->_execute('update', $sql, $bind);
    }
543912
public function update($table, array $columns, $where = '', $params = [])
    {
        if (empty($columns)) {
            return 0;
        }
        return $this->getUpdateBuilder()
            ->setTable($table)
            ->setColumns($columns)
            ->setWhere($where, $params)
            ->execute();
    }
467248
public function update(array $data, $where, $table = null)
    {
        $table = ($table) ?: $this->getTable();
        $sql = $this->getSql();
        $update = $sql->update($table);

        $update->set($data)
            ->where($where);

        $statement = $sql->prepareStatementForSqlObject($update);
        $result = $statement->execute();

        return $result->getAffectedRows();
    }
922842
public function update(array $data, $where) {
        $this->notifyObservers('beforeUpdate', array($this, &$data, &$where));
        $result = parent::update($data, $where);
        $this->notifyObservers('afterUpdate', array($this, $result, $data, $where));
        return $result;
    }
530132
public function delete($table, $where = '', $params = [])
    {
        return $this->getDeleteBuilder()
            ->setTable($table)
            ->setWhere($where, $params)
            ->execute();
    }
948625
public function Delete($table, $where = null)
    {
        if (empty($table) || empty($where) && is_array($where)) {
            return false;
        }

        $delete = $this->queryFactory->newDelete();

        //Set the table from which the data is to be deleted
        $delete->from($table);

        //Set the where
        $delete->where($this->convertWhereToString($where));

        return $this->exec($delete->getStatement());
    }