[eluser]shenanigans01[/eluser]
Hello, I'm trying to build a voting function. Is there an easy way to have an update function that simply gets the number from the datbase field and adds 1 to it...
Code:
function vote(){
$ID = $this->uri->segment(3);
$this->beer_model->vote('beers','id',$ID);
redirect(base_url().'index.php/beers/manage/');
}
is what I have in the controller, and in the model I have the following:
Code:
function vote($table,$fieldID,$ID){
$this->db->where($fieldID,$ID);
????????????????????????????????????
if ($this->db->affected_rows() == '1')
{
return TRUE;
}
return FALSE;
}
the '????' is where I'm not quite sure what to-do. Any help would be greatly appreicated!