CodeIgniter Forums
Column not found when use model-> but using builder is work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Column not found when use model-> but using builder is work (/showthread.php?tid=81122)



Column not found when use model-> but using builder is work - ferb - 01-25-2022

I have this problema, i try this code:
PHP Code:
$img $mImages->where('act_img>'0)
 ->
where('nom_img'$image)
 ->
first(); 

And show error column act_img not found, the field exist in database, and work with this code:
PHP Code:
$builder $this->db->table('images i');
 
$builder->where('i.act_img>'0);
 
$builder->orderBy('i.pos_img''asc');
 
$query $builder->get(); 
I use codeigniter 4.1.8, with xampp 8.1.2, php 8.1.2, os fedora 35 x86_64