my post data from form is coming as
Array
(
[radiogroup_1] => 1
[radiogroup_2] => 4
[radiogroup_4] => 11
[submit] => submit
)
and my model is
function add_votes(){
foreach($POST[] as $k=> $v){
$id = $v;
}
$this->db->where('answerid','radiogroup_'. $id );
$this->db->set('votes', 'votes+1',FALSE);
$this->db->update('vote_table');
}
apparently, it's not working.
foreach