[eluser]walrusk[/eluser]
Hey there
I'm pretty new to activerecord and mysql, but I'm picking it up quick so bear with me!
My question is whether or not it is possible to combine the following two queries into one:
Code:
$this->db->where('id',$this->uri->segment(3));
$data['folder'] = $this->db->get('folders');
$this->db->where('folder_id',$this->uri->segment(3));
$data['files'] = $this->db->get('files');
Basically I'm displaying a page of files contained in one folder. I also need the single row from the folder table so that I can display the folder title and other info.
I've looked into joins a bit, and I think I understand them somewhat, but I'm not sure if I can use them in a situation like this - can I? If not: is there another way to achieve this?
Any help is much appreciated! Thanks to all you Igniters of Code!