Welcome Guest, Not a member yet? Register   Sign In
How to get distinct results joining 3 MySql tables in Codeigniter?
#2

I know this is late but may help someone

PHP Code:
$db      = \Config\Database::connect();
$builder $db->table('payments p');
$builder->select('*');
$builder->join('flats f''f.flat_id = p.flat_id''left');
$builder->join('users u''u.user_id = f.owner_id''left');
$builder->groupBy('name');
$query $builder->get();
$data['table_joined'] = $query->getResult(); 
Reply


Messages In This Thread
RE: How to get distinct results joining 3 MySql tables in Codeigniter? - by remesses_thegreat - 05-24-2023, 03:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB