@param string $table
@param array  $bind
@param string $where

@return mixed
178568
public function update($table, array $bind, $where = '')
    {
        return $this->getAdapter()->update($table, $bind, $where);
    }
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);
    }
892564
public function update(string $table, array $data, array $where)
    {
        $created_at = $this->db->get($table, 'created_at', $where);
        $data['updated_at']=time();
        return $this->db->update($table, $data, $where);
        $data=[
            'created_at'=>$created_at
        ];
        return $this->db->update($table, $data, $where);
    }
347974
protected function _execute($sql, $bind)
    {
        if (!isset($this->_prepared[$sql])) {
            if (count($this->_prepared) > 8) {
                array_shift($this->_prepared);
            }
            $this->_prepared[$sql] = @$this->_getPdo()->prepare($sql);
        }
        $statement = $this->_prepared[$sql];

        foreach ($bind as $parameter => $value) {
            if (is_string($value)) {
                $type = \PDO::PARAM_STR;
            } elseif (is_int($value)) {
                $type = \PDO::PARAM_INT;
            } elseif (is_bool($value)) {
                $type = \PDO::PARAM_BOOL;
            } elseif ($value === null) {
                $type = \PDO::PARAM_NULL;
            } elseif (is_float($value)) {
                $type = \PDO::PARAM_STR;
            } elseif (is_array($value) || $value instanceof \JsonSerializable) {
                $type = \PDO::PARAM_STR;
                $value = json_encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
            } else {
                throw new NotSupportedException(['The `:1` type of `:2` parameter is not support', $parameter, gettype($value)]);
            }

            if (is_int($parameter)) {
                $statement->bindValue($parameter + 1, $value, $type);
            } else {
                if ($parameter[0] === ':') {
                    throw new InvalidValueException(['Bind does not require started with `:` for `:parameter` parameter', 'parameter' => $parameter]);
                }

                $statement->bindValue(':' . $parameter, $value, $type);
            }
        }

        @$statement->execute();

        return $statement;
    }
324848
public function updateRecords($table, array $data, $where)
    {
        $dbHandle = $this->getDatabaseConnection();
        list($updateSet, $prepareSet) = $this->prepareUpdateData($data);

        $query = 'UPDATE ' . $table . '
                  SET ' . implode(', ', $updateSet) . '
                  WHERE ' . $where;

        $statement = $dbHandle->prepare($query);
        $executeResult = $statement->execute($prepareSet);

        $statement = $this->checkQueryError($statement, $executeResult, $prepareSet);
        return $statement->rowCount();
    }
1178724
public function delete($where, $table = null)
    {
        $table = ($table) ?: $this->getTable();
        $sql = $this->getSql();
        $delete = $sql->delete($table);

        $delete->where($where);

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

        return $result->getAffectedRows();
    }
599397
public function insertRow($table, array $settings, $bind = true)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 3 must be an array or bool
            ->test(3, 'array', 'bool');
        
        //build insert query
        $query = $this->insert($table);
        
        //foreach settings
        foreach ($settings as $key => $value) {
            //if value is not a vulnerability
            if (is_null($value) || is_bool($value)) {
                //just add it to the query
                $query->set($key, $value);
                continue;
            }
            
            //if bind is true or is an array and we want to bind it
            if ($bind === true || (is_array($bind) && in_array($key, $bind))) {
                //bind the value
                $value = $this->bind($value);
            }
            
            //add it to the query
            $query->set($key, $value);
        }
        
        //run the query
        $this->query($query, $this->getBinds());
        
        //event trigger
        $this->trigger('sql-insert', $table, $settings);
        
        return $this;
    }
1054226
public static function query($sql,$bind=[])
    {
        try{
            $bind=is_array($bind) ? $bind : [$bind];
            self::$db=Connect::boot();
            Connect::comSql($sql);
            $sth = self::$db->prepare($sql);
            $sth->execute($bind);
            $sth->setFetchMode(\PDO::FETCH_ASSOC);

            return $sth;
        } catch (\PDOException $e) {
            throw new Exception($e->getMessage());
            //View::throwError($error);
        }
    }
785077
public static function update($table, $data = null, $where = null) {
        if ($data) {
            Update::update($table, $data, $where);
            return null;
        } else {
            return Update::table($table);
        }
    }
905161
public static function update($table,$where=[],$data)
    {
        if(empty($data)) throw new Exception("DB update data is null");
        
        $column='';
        $bind=[];
        $ends=count($data)-1;
        $n=0;
        foreach ($data as $key=>$value) {
            $column.="`{$key}`=:{$key}";
            $bind[$key]=$value;
            if($n!=$ends){
                $column.=',';
            }
            $n++;
        }
        if(empty($where)){
            $where='';
        }else{
            $w=new Where($where);
            $where=' WHERE '.$w->parseWhere();
            $bind=array_merge($bind,$w->parseBind());
        }
        $sql=sprintf('UPDATE `:%s` SET %s %s',$table,$column,$where);
        $bind=array_merge($bind,$bind);
        return self::execute($sql,$bind);
    }
667805
public function delete($tableName, $where = null)
    {
        list($where, $params) = $this->_buildWhere($where);
        $query = "DELETE FROM $tableName $where";
        
        $stmt = $this->prepare($query);
        $stmt->execute($params);
        return $stmt;
    }
816555
public function buildQuery(string $table, array $where): SqlParams
    {
        $whereClause = $this->buildWhereClause($where);
        $sql = "DELETE FROM {$table}" . $whereClause->getSql();
        return new SqlParams($sql, $whereClause->getParams());
    }
784723
function insert($table, array $bind)
    {
        $sql = $this->insertSql($table, $bind);
        // execute the statement and return the number of affected rows
        $stmt = $this->wrappedAdapter->query($sql, array_values($bind));
        $result = $stmt->rowCount();
        return $result;
    }
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;
    }
480853
public function fetchCol($sql, $bind = array())
    {
        $stmt = $this->query($sql, $bind);
        $result = $stmt->fetchAll(Zend_Db::FETCH_COLUMN, 0);
        return $result;
    }
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();
    }
981954
public function delete($where, $table = null)
    {
        if (is_array($where)) {
            $pk = $where[$this->getPrimaryKey()];
        } else {
            $pk = (int)$where;
        }

        $row = $this->getPosition($pk);

        $where = new Where;
        $where->between(self::COLUMN_LEFT, $row->getLft(), $row->getRgt());

        $result = parent::delete($where, $table);

        if ($result) {
            $this->updateTree($row->getRgt(), '-', $row->width());
        }

        return $result;
    }