> 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/lastinsertedid.md).

# lastInsertedId

Returns the last inserted id of auto increment data type.

**Usage:**

```php
$db->{table}->lastInsertedId();
```

**Example:**

```php
$lastId = $db->news->lastInsertedId();
```

Returns:

```json
// 1
```
