Welcome Guest, Not a member yet? Register   Sign In
Help With Generating Array For Table Class
#1

[eluser]Jay Logan[/eluser]
So I'm trying to use the HTML table class and I need to produce data from my database to use within the table. I'm assuming the database query needs to be stored in my model file. How can I produce an array of the data in the correct format for the table class? With model/controller combination I use, this error gets produced: Undefined table data.

Here is the model I'm using:

Code:
function unique_counties($id_name)
        {
            $this->db->select();
            $this->db->where('id_name', $id_name);
            $get_data = $this->db->get('VSS_src_network');
            $this->db->where_in('zip_code', explode(', ', $get_data->row()->addr_assoc));
            $this->db->distinct();
            $this->db->select('county_name');
            $this->db->orderby('county_name');
            $query = $this->db->get('JL_zip_codes');
            $result = $query->result_array();
            return $result;
        }


Here is my controller:

Code:
function show($id_name)
    {
        $this->load->model('licensee_model');

        $counties = $this->licensee_model->unique_counties($id_name);

        $this->load->library('table');
        $new_list = $this->table->make_columns($counties, 5);
        $table_options = array('table_open' => '<table width="100%">');

        $this->table->set_template($table_options);
        $data['counties_table'] = $this->table->generate($new_list);

        $this->load->view('profile', $data);
    }


Messages In This Thread
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 09:11 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 09:28 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 09:31 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 10:03 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 10:06 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 10:17 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 10:38 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 11:47 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 11:50 AM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 12:02 PM
Help With Generating Array For Table Class - by El Forum - 02-16-2009, 12:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB