> For the complete documentation index, see [llms.txt](https://sprnva.gitbook.io/sprnva-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sprnva.gitbook.io/sprnva-docs/database/selectloop.md).

# SelectLoop

selectLoop is for retrieving many rows from the table.

```php
// DB()->selectLoop($columns, $table, $whereParams);

<?php

namespace App\Controllers;

class UserController
{
    public function index()
    {
        $user_data = DB()->selectLoop('*', 'users', 'id > 0')->get();

        return view('/index', compact('user_data'));
    }
}
```

This is how you get the result of selectLoop.

```php
foreach($user_data as $users){
    echo $users['fullname'];
}
```
