> For the complete documentation index, see [llms.txt](https://jls-organization-3.gitbook.io/projecthyper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jls-organization-3.gitbook.io/projecthyper/features/quickstart/findone.md).

# findOne

Get one or specific record.

**Usage:**

```php
$db->{table}->findOne($where)
```

**Example:**

```php
$news = $db->news->findOne($where);
echo json_encode($news);
```

**Return:**

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

Using Primary ID for retrieval

<pre class="language-php"><code class="lang-php"><strong>$news = $db->news->findOne(1);
</strong>// {
//     "id": "1",
//     "name": "Test News",
//     "status": "ACTIVE",
//     "created_at": "2024-11-03 21:07:37",
//     "updated_at": null,
//     "deleted_at": null
// }

// If not existing
$news = $db->news->findOne(0);
// null
</code></pre>

Using other columns for retrieval

```php
$news = $db->news->findOne(
    array(
        'name' => 'Test News'
    )
);
// {
//     "id": "1",
//     "name": "Test News",
//     "status": "ACTIVE",
//     "created_at": "2024-11-03 21:07:37",
//     "updated_at": null,
//     "deleted_at": null
// }
```

Looking for the other parameters?

{% content-ref url="/pages/GBigEuwxBTtPN353H08f" %}
[Parameters](/projecthyper/features/quickstart/parameters.md)
{% endcontent-ref %}
