php - sending values from controller to views -
how can achieve this, sending data view controller form in view, need pick data on table in database , sending controller view,
here controller:
 public function new_orders(){     //data views form    in views  $category_id=$this->uri->segment(3);    $data['registration_number'] = $category_id;    //data model 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 form in view display registration_number @ same time product_id.
in view registration_number displayed not product_id, seems undefined variable. me please solve it
update code below, use $this->data instead of $data
$this->load->view("product_add", $this->data);      
Comments
Post a Comment