Welcome Guest, Not a member yet? Register   Sign In
Add extra columns to database generated table
#1

[eluser]Maxat[/eluser]
Hi,

I am new to Codeigniter and I seek your help in adding extra columns to the table generated from database.
The main thing is I need to add edit and delete columns to each generated row. Can you please help me?

Below is my code for controller
Code:
public function index() {

$config['base_url']= site_url('admin/fieldlist/index');
$config['total_rows']= $this->db->get('field')->num_rows();
$config['per_page']=5;
$config['num_links']=3;
$config['full_tag_open']= '<div id="pagination">';
$config['full_tag_close']='</div>';
$config['uri_segment'] = 4;

$this->pagination->initialize($config);

$data['records'] = $this->db->get('field',$config['per_page'],$this->uri->segment(1));

$this->load->view('admin/fieldlist_view',$data);
}




And View

Code:
<h3>Fields</h3>
  

  <div id="holder">
&lt;?php $this->table->set_heading('Field ID', 'Field Name');
   echo $this->table->generate($records);
   echo $this->pagination->create_links();
  ?&gt;
  
  </div>


Don't have a Module


Messages In This Thread
Add extra columns to database generated table - by El Forum - 02-22-2012, 01:06 AM
Add extra columns to database generated table - by El Forum - 02-22-2012, 10:29 AM
Add extra columns to database generated table - by El Forum - 02-22-2012, 10:27 PM
Add extra columns to database generated table - by El Forum - 02-23-2012, 12:29 PM
Add extra columns to database generated table - by El Forum - 02-23-2012, 01:28 PM
Add extra columns to database generated table - by El Forum - 02-24-2012, 02:27 AM
Add extra columns to database generated table - by El Forum - 02-24-2012, 09:13 AM
Add extra columns to database generated table - by El Forum - 02-26-2012, 08:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB