Answers for "codeigniter 4 join with where"

PHP
2

how to use join query in codeigniter

public function getdata(){	

	$this->db->select('*');
	$this->db->from('table1'); // this is first table name
	$this->db->join('table2', 'table2.id = table1.id'); // this is second table name with both table ids
	$query = $this->db->get();
	return $query->result();

	}
Posted by: Guest on July-11-2020
0

codeigniter 3 join

$this->db->select('*');
$this->db->from('blogs');
$this->db->join('comments', 'comments.id = blogs.id');
$query = $this->db->get();

// Produces:
// SELECT * FROM blogs JOIN comments ON comments.id = blogs.id
Posted by: Guest on March-15-2022

Code answers related to "codeigniter 4 join with where"

Browse Popular Code Answers by Language