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

# lastQuery

Returns the last executed query in string format.

**Usage:**

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

**Example:**

```php
$news = $db->news->lastQuery();
```

Returns:

```json
// SELECT * FROM news
```
