[eluser]Uplift[/eluser]
Hi, How can i filter results coming from the database? in this case it's by category,
i use the following code in my model:
Code:
function getEntries() {
$this->db->order_by("id", "desc");
$query = $this->db->get_where('work', array('published' => '1'));
return $query->result_array();
}
and controller to call it:
Code:
$data['entries'] = $this->work_model->getEntries();
All pretty standard stuff but how do i filter by category?
eg, if user clicks 'all' it shows all entries, if user clicks 'web' it shows all websites
the links would be something like
/portfolio/ - if they click this link it would show all
/portfolio/web - if they click this link it will show only all websites
/portfolio/graphics - if they click this link it will show only all graphics