[eluser]tmac[/eluser]
hi, I am creating a page to force download a csv file. I have the error in the topic when i use the following codes.
Code:
// Load the DB utility class
$this->load->dbutil();
$query = $this->db->query("SELECT first_name, last_name, addr_line1, addr_line2, city, state, zipcode, phone FROM ".$this->config->item('users_tbl'));
$delimiter = ",";
$newline = "\r\n";
$backup =& $this->dbutil->csv_from_result($query, $delimiter, $newline);
// Load the download helper and send the file to your desktop
$this->load->helper('download');
force_download('user_address.csv', $backup);
Any help on this matter would be greatly appreciated. Thanks