[eluser]Brad K Morse[/eluser]
exportCsv data_model method was posted in the original thread
here it is
Code:
// model function
function exportCsv() {
$this->load->dbutil();
$q = $this->db->order_by('first_name','asc')->get('data');
return $this->dbutil->csv_from_result($q, ",", "\n");
}