Updates a table

@param string       $table
@param              $set
@param string       $where
@param array        $bind
@internal param type $info
@return int
516700
public function update($table, $set, $where, $bind = array())
    {
        $sql = "UPDATE " . $table . " SET ";

        if(is_array($set)) {
            foreach($set as $field => $value) {
                $sql .= $field ." = ". $value . ",";
            }

            $sql = rtrim($sql,",");

        }else{
            $sql .= $set;
        }


        $sql .= " WHERE " . $where . ";";

        $bind = $this->cleanup($bind);

        return $this->run($sql, $bind);
    }
553795
public function update($table, array $data = [], $where = '', array $whereBind = [])
    {
        $fields = '';
        $bind = [];
        //jeśli brak danych wyjście z metody
        if (empty($data)) {
            return 1;
        }
        //wiązanie parametrów
        foreach ($data as $key => $value) {
            $bindKey = PdoBindHelper::generateBindKey();
            $fields .= $this->prepareField($key) . ' = :' . $bindKey . ', ';
            $bind[$bindKey] = $value;
        }
        //budowanie zapytania aktualizującego
        $sql = 'UPDATE ' . $this->prepareTable($table) . ' SET ' . rtrim($fields, ', ') . ' ' . $where;
        return $this->query($sql, array_merge($bind, $whereBind))->rowCount();
    }
1138816
public function update($tableName, array $data, $where = null)
    {
        return $this->pdo->update($tableName, $data, $where);
    }
1106813
public function delete($table, $where = [], array $bind = [])
    {
        $table = $this->quote()->identifier($table);
        $sql   = "DELETE FROM $table";
        if (is_array($where)) {
            $where = $this->createWhereExpression($where);
        }
        $sql .= (($where) ? " WHERE {$where}" : '');

        $stmt = $this->query($sql, $bind);

        return $stmt->rowCount();
    }
811415
public function updateBatch(array $sets, array $where = [])
    {
        $this->where($where);
        $this->builderCache->store('sets', $sets);

        return $this->platformUpdateBatchHandler($this->builderCache);
    }
970775
function update($tableName, $values, $wheres)
  {
    assert(is_array($values));
    assert(is_array($wheres));

    $v = [];
    foreach ($values as $key => &$value)
      $v[] = "`$key`=".$this->quote($value);

    $w = $this->makeClauses($wheres);

    $this->q
    (
      "update $tableName set ".
      implode(",",$v).
      " where ".
      implode(" and ",$w)
    );
  }
508985
private function getSetStmt($syntax, $table, $data, $where = null)
    {
        $columns = array();

        foreach (array_keys($data) as $column) {
            $columns[] = "`" . $column . "` = ?";
        }
        $columns = implode(", ", $columns);

        $sql = "$syntax `$table` SET " . $columns . $this->buildWhere($where);

        return $this->prepare($sql);
    }
945093
public function update(array $data, $where)
    {
        $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
        return $this->_db->update($tableSpec, $data, $where);
    }
1303344
public function join($table, $on = null, $where = null, $binds = [])
    {
        if (!$on) {
            $this->join[] = $table;
        } else {
            $this->join[] = $table . (strpos($table, ' ON ') ? ' AND ' : ' ON ') . $on;
        }

        if ($where) {
            $this->where(new Raw($where));
        }

        if ($binds) {
            foreach ($binds as $bind) {
                $this->bind($bind, 'join');
            }
        }

        return $this;
    }
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);
    }
41358
public static function delete($table, $where = null) {
        if ($where) {
            Delete::delete($table, $where);
        } else {
            return Delete::table($table);
        }
        return null;
    }
170218
public function updateEntityById($entity, $bind, $id)
    {
        $tbl = $this->resource->getTableName($entity);
        if ($bind instanceof DataObject) {
            $data = $bind->get();
        } else {
            $data = $bind;
        }
        $where = '1';
        foreach ($id as $field => $value) {
            $where .= " AND $field=" . $this->conn->quote($value);
        }
        $result = $this->conn->update($tbl, $data, $where);
        return $result;
    }
719676
public function update($table, array $data, $where = [], array $bind = [])
    {
        $table  = $this->quote()->identifier($table);
        $fields = [];
        foreach ($data as $field => $value) {
            $fields[] = $this->quote()->into("{$field} = ?", $value);
        }
        $sql = "UPDATE $table SET " . implode(', ', $fields);
        if (is_array($where)) {
            $where = $this->createWhereExpression($where);
        }
        $sql .= (($where) ? " WHERE {$where}" : '');

        $stmt = $this->query($sql, $bind);

        return $stmt->rowCount();
    }
983998
public function whereRaw($where, $bind = [], $logic = 'AND')
    {
        if ($bind) {
            $this->bindParams($where, $bind);
        }

        $this->options['where'][$logic][] = $this->raw($where);

        return $this;
    }
622876
public function insertOrUpdate($table, array $set, array $where)
    {
        if ($this->select($table, $where)) {
            $result = $this->update($table, $set, $where);
        } else {
            $params = array_merge($where, $set);
            $result = $this->insert($table, $params);
        }

        return $result;
    }
796476
public function update($tableName, array $data, $where = null)
    {
        list($where, $params) = $this->_buildWhere($where);
        
        $set = array();
        foreach ($data as $column => $value) {
            $set[] = "$column = ?";
        }
        $query = "UPDATE $tableName SET " . implode(', ', $set) . " $where";
        $params = array_merge(array_values($data), $params);
        
        $stmt = $this->prepare($query);
        $stmt->execute($params);
        return $stmt;
    }
675839
public function cuUpdate($tableName, array $assocDataArray, $where)
    {

        $updateStr = '';
        $where     = ' WHERE ' . $where;

        foreach ($assocDataArray as $key => $val) {
            $valEscaped = $this->real_escape_string($val);
            $updateStr  .= ' ' . $key . ' = "' . $valEscaped . '", ';
        }

        $updateStr = substr($updateStr, 0, -2);
        $q         = 'UPDATE ' . $tableName . ' SET ' . $updateStr . $where;

        return $this->cuQuery($q);
    }