Executa com UPDATE no banco
@param $table - Nome da Tabela
@param $data - Dados que vão ser atualizados
@param $where - WHERE da query do update
@return bool - Sucesso ou falha
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();
    }
740650
protected function prepareDelete($table, $where){
        $sql= 'DELETE FROM ' . $table . ' ';            
        if($where != ''){$sql.= " WHERE " . $where;}
        //Preparo la consulta y la retorno
        return  $this->connection->prepare($sql);
    }
1126545
public function buildUpdateSQL($table = null, $data = array())
	{
		$sql = 'update ' . $this->parseTable($table) . ' set ';
		if(is_string($data))
		{
			$sql .= $data . ' ';
		}
		else
		{
			$data = $this->parseParams($data);
			foreach($data as $key => $value)
			{
				$sql .= $this->parseKeyword($key) . '=:' . $this->parseParamName($key) . ',';
			}
		}
		$where = $this->parseCondition(isset($this->operationOption['where']) ? $this->operationOption['where'] : '');
		if ('' !== $where)
		{
			$where = 'where ' . $where . ' ';
		}
		return substr($sql,0,-1) . ' '
				. $where
				. $this->parseOrder()
				. $this->parseLimit()
				. $this->parseLock()
				;
	}
565918
public function delete($table, array $where)
    {
        $query = "DELETE FROM `$table` WHERE ";

        $bind = array();
        foreach ($where as $column => $value) {
            $query .= "`$column` = ? AND ";
            $bind[] = $value;
        }

        $query = substr($query, 0, -5);

        // Prepare, bind and execute
        $statement = $this->prepare($query);
        foreach ($bind as $idx => $value) {
            $statement->bindValue(($idx + 1), $value, Database::typeOfValue($value));
        }

        return $statement->execute();
    }
401304
public function updateById($table, $data, $id = "id")
    {
        // check for id
        if (!isset($data[$id]))
            Throw new \ErrorException("SQL Error: Can't update because of bad data.");

        $options = array('W' => '`' . $id . "`='" . $this->escape($data[$id]) . "'");

        try {
            $this->update($table, $data, $options);
            return $data[$id];
        } catch (\Exception $e) {
            throw $e;
        }
    }
1006801
public function update($table, $data, $where = '')
    {
        $fieldDetails = null;
        foreach ($data as $key => $value) {
            $fieldDetails .= "$key = :$key,";
        }
        $fieldDetails = rtrim($fieldDetails, ',');
        $query = "UPDATE $table SET $fieldDetails ".($where ? 'WHERE '.$where : '');
        $this->prepare($query);

        foreach ($data as $key => $value) {
            $this->bind(":$key", $value);
        }
        try {
            $this->execute();

            return true;
        } catch (PDOException $e) {
            echo $e->errorInfo[2];

            return false;
        }
    }
1323948
public function update($table, $data){
		$statement = Statement::createUpdate($this->connection, $table, $data);
		foreach($this->observers as $observer){
			$statement->attachObserver($observer, $this->observers->getInfo());
		}
		return $statement;
	}
953981
public function update($table, $params, $where) {
		$params = $this->filter_table_data($table, $params, $this);

		$keys = array_keys($params);
		foreach ($keys as $key => $value) {
			$keys[$key] = $this->quote_identifier($value);
		}

		$query = 'UPDATE ' . $this->quote_identifier($table) . ' SET ';

		$first = true;
		foreach ($params as $key => $value) {
			if (!$first) {
				$query .= ', ';
			}
			$query .= $this->quote_identifier($key) . '= ?';
			$first = false;
		}

		$query .= ' WHERE ' . $where;

		$statement = $this->get_statement($query, $params);
		$statement->execute();
	}
933861
public function update($table, array $data = [], $where = null): array
    {
        if (\is_array($table)) {
            $data = $table[SQL::SET] ?? $table[SQL::VALUES];
            $where = $table;
            $table = $this->getTable($table, SQL::UPDATE);
        } elseif ($where) {
            $where = [SQL::WHERE => $where];
        }

        $fields = [];
        $map = [];

        foreach ($data as $key => $value) {
            $column = $this->columnQuote(\preg_replace("/(\s*\[(\+|\-|\*|\/)\]$)/i", '', $key));

            if ($raw = $this->buildRaw($value, $map)) {
                $fields[] = $column . ' = ' . $raw;
                continue;
            }

            $mapKey = $this->mapKey();
            \preg_match('/(?<column>\w+)(\[(?<operator>\+|\-|\*|\/)\])?/i', $key, $match);

            if (isset($match['operator'])) {
                if (\is_numeric($value)) {
                    $fields[] = $column . ' = ' . $column . ' ' . $match['operator'] . ' ' . $value;
                }
            } else {
                $fields[] = $column . ' = ' . $mapKey;
                $map[$mapKey] = $this->typeMap($value, \gettype($value));
            }
        }

        $sql = 'UPDATE ' . $this->tableQuote($table) . ' SET ' . \implode(', ', $fields) .
            $this->suffixClause($where, $map);

        return [$sql, $map];
    }
1276259
public function delete($table, $where)
    {
        $context = $this->getCommandContext();
        $context->table    = $table;
        $context->data    = null;
        $context->where    = $where;
        $context->operation    = AnDatabase::OPERATION_DELETE;

        //Excute the delete operation
        if ($this->getCommandChain()->run('before.delete', $context) !== false) {
            //Create query statement
            $context->query = 'DELETE FROM '.$this->quoteName($this->getTableNeedle().$context->table)
                  .' '.$context->where
            ;

            //Execute the query
            $context->result = $this->execute($context->query);

            $context->affected = $this->_affected_rows;
            $this->getCommandChain()->run('after.delete', $context);
        }

        return $context->affected;
    }
399146
public static function q_check(string $table, string $where = ''): bool
    {
        return (bool)self::getInstance()->sql_query('SELECT NULL FROM `' . $table . '`' . ($where ? ' WHERE ' . $where : '') . ' LIMIT 1')->rowCount();
    }
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);
    }
767368
public function deleteFrom(string $table, array $where): int
    {
        $delete = new Delete($this->options);
        $sqlParams = $delete->buildQuery($table, $where);
        return $this->query($sqlParams->getSql(), $sqlParams->getParams())->getAffected();
    }
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;
    }
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);
    }
707647
public function updateBatch(string $table, $data, $where): ?PDOStatement
	{
		// Get the generated values and sql string
		list($sql, $data) = $this->driver->updateBatch($table, $data, $where);

		return $sql !== NULL
			? $this->_run('', $table, $sql, $data)
			: NULL;
	}
171854
public function ExecuteInsert($table, $data)
    {
            if (is_object($data))
                ModelState::ModelTreatment($data);

            $data = (array)$data;

            // Ordena
            ksort($data);

            // Campos e valores
            $camposNomes = implode('`, `', array_keys($data));
            $camposValores = ':' . implode(', :', array_keys($data));

            // Prepara a Query
            $sth = $this->prepare("INSERT INTO $table (`$camposNomes`) VALUES ($camposValores)");

            // 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);
            }

            // Executa
            $sth->execute();

            // Retorna o ID desse item inserido
            return $this->lastInsertId();
    }