Link Reference inside of Table Library - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Link Reference inside of Table Library (/showthread.php?tid=25658) |
Link Reference inside of Table Library - El Forum - 12-19-2009 [eluser]Julian_Omaha[/eluser] When I try to run the following view (below), I am getting this message. Anyone know what might be causing this? From the Controller: ++++++++++++++++++++++++++++++++ $data['records'] = $this->db->get('tbl_emp', $config['per_page'], $this->uri->segment(4)); $data['title'] ="Administration"; $data['navlist']=$this->mod_customer->get_customer_horizontal_menu_choices($this->session->userdata('customer_id')); $data['vertical_menu'] = $this->mod_customer->get_customer_vertical_choices($this->session->userdata('customer_id'),'administration'); $data['secondary_content']= "administration/admin_secondaryContent.php"; $data['main']='employee/vw_employee_list_test_pagination_template'; $this->load->vars($data); $this->load->view('includes/template', $data); ++++++++++++++++++++++++++++++++++ From the View ++++++++++++++++++++++++++++++++++ <?php $this->table->set_heading('Employee Id', 'First', 'M', 'Last', 'SS#', 'DOB', 'Status', 'Customer', 'Effective', 'updated', 'update'); echo anchor('index.php/Administration/employee_management/add_employee_form', 'Add New Employee'); foreach($records as $key=>$list){ echo $this->table->add_row("'".$list['emp_id'],"', 'First', 'M', 'Last', 'SS#', 'DOB', 'Status', 'Customer', 'Effective', 'updated', 'update'"); }; echo $this->pagination->create_links(); ?> ++++++++++++++++++++++++++++++++++++++ Error Message A PHP Error was encountered Severity: Notice Message: Undefined index: emp_id Filename: employee/vw_employee_list_test_pagination_template.php Line Number: 21 Link Reference inside of Table Library - El Forum - 12-19-2009 [eluser]Colin Williams[/eluser] Yeah. Your $list variable has no 'emp_id' index. Use print_r() to see exactly how it is constructed. |