📕
Sprnva Docs
  • Introduction
  • What's New?
  • Installation
    • Requirements
    • Download Sprnva zip no composer required
    • Install Sprnva Using Composer
    • Setup Config
  • Deployment
  • File Structure
  • Database
    • Select
    • SelectLoop
    • Insert
    • Update
    • Delete
    • Query
    • Seeder
    • Paginate
    • With
    • andFilter
    • withCount
    • get
  • Query Builder
  • Migration
    • INSTANCES
      • NEW
      • RENAMETABLE
      • DROP
      • CHANGE
    • DUMPS
      • dump
      • dump prune
    • MAKE
    • MIGRATE
      • migrate
      • migrate fresh
    • ROLLBACK
  • Routing
    • with parameter
    • multiple parameters
    • with closure
    • group
    • controller grouping
  • Controllers
    • methods
  • Views
    • Passing Parameters
  • Validation
    • validate
      • validation type
  • Authentication
  • Alert Messages
  • Default Helpers
  • CSRF Protection
  • Email
  • Packages
    • Fortify
  • Themes and Templates
Powered by GitBook
On this page
  1. Database

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'];
}
PreviousSelectNextInsert

Last updated 2 years ago