Welcome Guest, Not a member yet? Register   Sign In
Need help about Query Bilder
#1

I have read through the CI 4 docs but still confused about the query builder. Following code shows my current CI4 model:

PHP Code:
<?php
namespace App\Models;
use 
CodeIgniter\Model;

class 
TestModel extends Model
{

    protected $db;

    public function __construct( )
    {
        $this->db db_connect();
    }

 private function 
checkData$t$v) {
 return 
$db->table$t )->select()->where$d )->countAllResults();
 }


But I am little bit confused about the CI4 ways to get row or rows from database. In CI3 my code was:

PHP Code:
// Get rows
$query $this->db->select()->from$table )->where$arr )->get();
return 
$query->result();

// Get row
$query $this->db->select()->from$table )->where$arr )->get();
return 
$query->row(); 

Could you please help by write some demo code of the following two operations?

Thanks in advance.
"Who thinks in code"
Perfectly describes who I am
mbparvez.me
Reply


Messages In This Thread
Need help about Query Bilder - by webdevron - 08-28-2019, 11:55 AM
RE: Need help about Query Bilder - by InsiteFX - 08-28-2019, 04:53 PM
RE: Need help about Query Bilder - by webdevron - 08-29-2019, 04:09 PM
RE: Need help about Query Bilder - by InsiteFX - 08-30-2019, 04:37 AM
RE: Need help about Query Bilder - by webdevron - 08-31-2019, 11:29 AM
RE: Need help about Query Bilder - by InsiteFX - 08-30-2019, 08:36 AM
RE: Need help about Query Bilder - by InsiteFX - 08-31-2019, 12:17 PM
RE: Need help about Query Bilder - by dave friend - 08-31-2019, 02:10 PM
RE: Need help about Query Bilder - by webdevron - 09-01-2019, 04:46 AM
RE: Need help about Query Bilder - by InsiteFX - 09-01-2019, 12:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB