// Adding the product and returning the aggregate product ID
public function new_product()
{
$data = array(
'name' => $this->input->post('name'),
'details' => $this->input->post('details'),
'price' => $this->input->post('price')
);
$this->db->insert('products', $data);
if($this->db->affected_rows()) {
return $this->db->insert_id();
}
return false;
}