# update

**Usage:**

```php
$db->{table}->update($where, $data);
```

<pre class="language-php"><code class="lang-php"><strong>$news = $db->news->update(
</strong>    array('id' => 1),
    array('name' => 'Updated name')
);
// or
$news = $db->news->update(
    1, // WHERE 1 is your primary ID
    array('name' => 'Updated name')
);
</code></pre>

**Return:**

```json
{
    "id": "AUTO_GENERATED_ID",
    "name": "Updated name",
    "status": "ACTIVE",
    "created_at": "2024-11-03 21:07:37",
    "updated_at": "2024-11-03 21:07:37",
    "deleted_at": null
}
```

Looking for the other parameters?

{% content-ref url="parameters" %}
[parameters](https://jls-organization-3.gitbook.io/projecthyper/features/quickstart/parameters)
{% endcontent-ref %}
