JOIN child records to parent records with CodeIgniter's query builder
In DB I have two tables:
store_module->caffe_id, module_id, position, order
module->id_module, name, description, image
I have query where I take all modules for set ID (store_module table), and I need to get all modules which appear in this query (module_id). What I need to do? This is the code:
public function mar_get_modules($id)
{
$q = $this->db->get_where('store_module', array('caffe_id' => $id));
$modules = $q->result_array();
}