SelectLoop
selectLoop is for retrieving many rows from the table.
// 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.
foreach($user_data as $users){
echo $users['fullname'];
}
Last updated