How can I achieve this, I am sending data from view to controller then back to another form in view, then also I need to pick data on table in database and sending it to controller then to view,
Here is my controller:
public function new_orders(){
//data from views then to another form
in views $category_id=$this->uri->segment(3);
$data['registration_number'] = $category_id;
//data from model to view
$this->data["product_id"]=$this->select->get_product_id();
$this->load->view("product_add", $data);
}
My model:
function get_product_id(){
$this->db->select_max('product_id');
$this->db->from('products');
$query = $this->db->get();
return $query->result_array();
}
I want a form in view to display registration_number at the same time product_id.
In view registration_number is displayed but not product_id, it seems to be undefined variable. Help me please to solve it