Retorna un PDOStatement UPDATE armado en base a los parametros pasados
@param string $table
@param array $values
@param string $where
@return PDOStatement
424528
protected function prepareUpdate($table, $values, $where){
        $sql= 'UPDATE ' . $table . ' SET ';
        foreach ($values as $key => $value) {
            $sql .= $key . '=:' . $key . ',';
        }
        $sql = trim($sql, ',');
        if($where != ''){$sql.= " WHERE " . $where;}
        //Preparo la consulta y la retorno
        return  $this->connection->prepare($sql);
    }
1374296
public function delete($table, array $where)
    {
        $keys = array_keys($where);
        $values = array_values($where);

        $replace = function ($key) { return $key . "=?"; };

        $where = implode(' AND ', array_map($replace, $keys));

        $sql = "DELETE FROM {$table} WHERE {$where}";

        return $this->query($sql, $values);
    }
1364581
public function Where($condition, $values) {
        $this->setWhere($condition);
        $this->addBindValues($values);
        return $this;
    }
920845
public function update(array $data, array $where)
    {
        if (!$where) {
            die ('Where is required');
        }

        if (!$data) {
            die ('Data is required');
        }

        return $this->_update($data, $where);
    }
189263
public function update($table, array $fields, array $where)
    {
        $fieldsKeys = array_keys($fields);
        $fieldsValues = array_values($fields);

        $whereKeys = array_keys($where);
        $whereValues = array_values($where);

        $replace = function ($key) { return $key . "=?"; };

        $set = implode(',', array_map($replace, $fieldsKeys));
        $where = implode(' AND ', array_map($replace, $whereKeys));

        $sql = "UPDATE {$table} SET {$set} WHERE {$where}";

        return $this->query($sql, array_merge($fieldsValues, $whereValues));
    }
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;
    }
1101560
public function countWhere($where, array $values = [])
    {
        $sql = sprintf(
            "select count(*) as result from %s where :condition",
            $this->getStructure()->getRelation()
        );

        return $this->fetchSingleValue($sql, $where, $values);
    }
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);
    }
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();
	}
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());
    }
1305650
public static function update($table, $data, $where) {
        $update = Update::table($table);
        foreach ($data as $field => $value) {
            $update->set($field, $value);
        }
        if (is_array($where)) {
            foreach ($where as $field => $value) {
                $update->where($field, $value);
            }
        } else {
            $update->where("id", $where);
        }
        $update->excuse();
    }
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);
	}
196375
public static function c($table, $where) {
        $row = DB::qbr($table, array("where" => $where, "cols" => "id"));
        if (!$row) return false;
        return $row["id"];
    }
785077
public static function update($table, $data = null, $where = null) {
        if ($data) {
            Update::update($table, $data, $where);
            return null;
        } else {
            return Update::table($table);
        }
    }
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);
    }
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();
    }
681803
public function update($table, $data, $statements, $where)
    {
        $query = 'UPDATE `' . $table . '`  SET ';

        foreach ($data as $column => $value) {
            $value = (is_null($statements) && is_string($value)) ? "'$value'" : $value;
            $query .= $column . '=' . $value . ', ';
        }

        $query = rtrim(trim($query), ',');

        $query .= (! is_null($where)) ? ' WHERE ' : '';

        $query .= (is_string($where)) ? $where . ' ' : '';

        if (is_array($where)) {
            foreach ($where as $clause) {
                $query .= $clause . ' AND ';
            }
            $query = rtrim(trim($query), 'AND');
        }

        if (! is_null($statements) && is_array($statements)) {
            return $this->statements($query, $statements);
        }

        return $this->query($query, 'INSERT');
    }