Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 V 4.5.1 $this->db problem
#13

Then we can get benefit of protected

Code:
    protected $table = 'items';
    protected $primaryKey = 'item_id';
    protected $allowedFields = ['field1', 'field2', 'field3'];

Then:

PHP Code:
public function get_all_items()
    {
        return $this->findAll(); 
    }

    
    
public function fetch_single_item($item_id)
    {
        return $this->where('item_id'$item_id)
                    ->first(); 
    



Is this what you are looking for?
Reply


Messages In This Thread
RE: Codeigniter 4 V 4.5.1 $this->db problem - by demyr - 05-17-2024, 01:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB