Welcome Guest, Not a member yet? Register   Sign In
build query for 2 different table
#2

Look for the join() function on this page: https://codeigniter.com/user_guide/datab...ilder.html

PHP Code:
$builder $db->table('blogs');
$builder->select('*');
$builder->join('comments''comments.id = blogs.id');
$query $builder->get();

// Produces:
// SELECT * FROM blogs JOIN comments ON comments.id = blogs.id 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
Reply


Messages In This Thread
build query for 2 different table - by zhikri - 09-30-2021, 08:46 PM
RE: build query for 2 different table - by includebeer - 10-04-2021, 04:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB