link table in codeigniter
03:02 24 Jun 2014

i'm a newbie for using codeigniter ,i'm learn for develop an application base on mysql database for my school project, i have 10table ( table1,table2,....table10), i'm create my model just like this

class Show_model extends CI_Model{

    function __construct()
    {
        parent ::__construct();
    }

    function table1()
    {
        $query1 = $this->db->get('table1');
        return $query1->result();        
    }

    function table2()
    {
        $query2 = $this->db->get('table2');
        return $query2->result();        
    }
    bla....bla......................



    function table10()
    {
        $query10 = $this->db->get('table10');
        return $query10->result();        
    }
}

and my controller just like this

class Show extends CI_Controller{

    function __construct(){
        $this->load->model('show_model');
    }

    function show_table1()
    {
        $data['show_table1']   = $this->show_model->table1();        
        $this->load->view('v_page_1',$data);
    }

    function show_table2()
    {
        $data['show_table2']   = $this->show_model->table2();        
        $this->load->view('v_page_2',$data);
    }

    bla....bla....


}

and my goal is :

  1. how to simply my code

  2. how to show / view on one page and create a link for each table to show

this is i want to show:

clik to show : table1|tabel2|table3|......|

-----------------------
|itemA | itemB |itemC |
-----------------------
|      |       |      |
|      |       |      |
-----------------------

cant somebody help me, or explained how can i do that, or maybe some share a link for tutorial

php mysql codeigniter model-view-controller url-routing