Welcome Guest, Not a member yet? Register   Sign In
Display 3 columns in pagination?
#3

[eluser]machouinard[/eluser]
Code:
$this->db->select('ID, Offering, Seeking');

EDIT:
There's no pagination involved, but you could try this:
Code:
$this->load->library('table');
$this->db->select('ID, Offering, Seeking');
$this->db->from(Your_Table);
$query = $this->db->get();
$result = $query->result();
$array = array();
foreach($result as $row){
    $line = array($row->ID, $row->Offering, $row->Seeking);
    array_push($array, $line);
}
$this->table->set_heading('ID', 'Offering', 'Seeking');
echo $this->table->generate($array);

Or this if you prefer less codeSadassuming ID is a PK)
Code:
$this->load->library('table');
$query = $this->db->get(YOUR_TABLE)->result();
foreach($query as $row){
    $array[$row->ID] = array($row->ID, $row->Offering, $row->Seeking);
}
$this->table->set_heading('ID', 'Offering', 'Seeking');
echo $this->table->generate($array);


Messages In This Thread
Display 3 columns in pagination? - by El Forum - 03-10-2012, 10:57 AM
Display 3 columns in pagination? - by El Forum - 03-10-2012, 12:01 PM
Display 3 columns in pagination? - by El Forum - 03-10-2012, 04:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB