Display an incrementing number in each row when using table class

#6
[eluser]flaky[/eluser]
one other way you could do it, change function in the the model to this
Code:
$query = $this->db->get('mytable');

$nr = 1;
$data = "";
foreach ($query->result() as $row)
{
    $data[] = array('no' => $nr, 'value' => $row->item_1);
    $nr++;
}

return $data;


Messages In This Thread
Display an incrementing number in each row when using table class - by El Forum - 01-07-2010, 04:01 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.