[eluser]srpurdy[/eluser]
You not setting the array properly. but I don't think you need the [ ] brackets either in the array itself.
You would do something like
Code:
$my_array = array();
Code:
$this->db->set($my_array);
Below is an example of a poll I did
Code:
#controller function
function submit()
{
if($this->input->post('opt_id') == '0')
{
$this->errors->poll_no_selection();
}
else
{
$this->poll_model->submit_vote($this->input->post('userid'), $this->input->post('poll_id'), $this->input->post('opt_id'));
redirect('/poll/iframe/' . $this->input->post('poll_id'));
}
}
Code:
#model function
function submit_vote($userid, $pollid, $optid)
{
$array = array(
'poll_id' => $pollid,
'opt_id' => $optid,
'userid' => $userid
);
$this->db->set($array);
$this->db->insert('poll_votes', $this->db->escape($_POST));