Welcome Guest, Not a member yet? Register   Sign In
Pagination for table with mysql data
#5

[eluser]targeting[/eluser]
Here is the part of the code:

$datatable = $this->site_model->get_query_table($convertdate,$replacedtype);


$data1['table'] = '<table id="myTable" class="tablesorter" >
<thead><tr><th>Server</th><th>Media_Server</th><th width="220px">Server_Status</th><th width="50px">Files</th></tr></thead><tbody>';

for ($i = 0; $i < count($datatable); $i++) {
$server = $datatable[$i]->Server;
$mediaserver = $datatable[$i]->Domain_Backup_Server;
$files= $datatable[$i]-> Files;
$jobname= $datatable[$i]-> Job_Name;
$data1['table'] .= '<tr >td>'.$server.'</td><td>'.$mediaserver.'</td><td>'.$replacedtype.'</td><td><a target="_blank" href="'.$files.'">'.$jobname.'</a></td></tr>';
}
$data1['table'] .= '</tbody></table>';


$config['base_url'] = 'http://xyz';
$config['total_rows'] = count($datatable);
print_r( $config['total_rows']);
$config['per_page'] = 10;
$config['num_links'] = 20;
// $config['full_tag_open'] = '<div id="pagination">';
// $config['full_tag_close'] = '</div>';

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

So I need counting the rows from table "$data['table']" and not from mysql, because data from mysql is already in table


Messages In This Thread
Pagination for table with mysql data - by El Forum - 04-05-2012, 11:48 AM
Pagination for table with mysql data - by El Forum - 04-05-2012, 01:07 PM
Pagination for table with mysql data - by El Forum - 04-05-2012, 01:19 PM
Pagination for table with mysql data - by El Forum - 04-05-2012, 01:22 PM
Pagination for table with mysql data - by El Forum - 04-05-2012, 01:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB