Question: I have a cakePHP problem - I want to make a update query like this

`UPDATE table SET field = field + some_var` 

and I don't know how to do it...

Can anyone help me?

Answer: 
The only "right" way would be using cake's "atomic query" wrapper methods. In your case that would be "updateAll".
The question is a complete duplicate of a dozen other questions - like [Incrementing Cakephp database field by a value](https://stackoverflow.com/questions/8689203/incrementing-cakephp-database-field-by-a-value)

```
$var = 1;
$this->Article->updateAll(
    array('Article.viewed' => 'Article.viewed + ' . $var),                    
    array('Article.id' => $id)
);

```

This is also in the docs: <http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-updateall-array-fields-array-conditions>
There are two ways to do an update:

If you are only updating one field you can do:

```
$this->Model->id = foo;
$this->Model->saveField('field_name', 'field_value');

```

or, you can do an update using $this->Model->save():

```
$data = array(
    'Model'=>array(
        'id'=>foo,
        'field_name'=>'field_value',
        'another_field_name'=>'another_field_value'
    )
);

$this->Model->save($data);

```

You want to avoid using $this->Model->query() and use CakePHP's built in methods because the build in methods are datasource agnostic (they work the same on MySQL, Oracle, MSSQL etc.)