[eluser]pickupman[/eluser]
Try using something like:
Code:
if($this->db->insert('mytable', $data){
//successfully insert
}else{
//Something wrong happened.
}
My guess if you are getting a duplicate entry, is that you have a set a column (id) to be the primary index, but either have not set the field to autoincrement. Or the other maybe that you are trying to add the primary key to the array you are trying to insert as a row, when it should be omitted.