View Single Post
  #3 (permalink)  
Old September 4th, 2012, 06:08 PM
plavalle plavalle is offline
Registered User
Points: 55, Level: 1
Points: 55, Level: 1 Points: 55, Level: 1 Points: 55, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 3 Times in 3 Posts
Default Fatal Error in Export CSV

I'm getting this error when I click on the Category link:
Code:
( ! ) Fatal error: Cannot redeclare MCats::exportCsv() in C:\wamp\www\ci_fullsite_professional\application\models\mcats.php on line 183
Model - MCats:
Code:
function exportCsv(){
	$this->load->dbutil();
	$Q = $this->db->query("select * from categories");
	return $this->dbutil->csv_from_result($Q,",","\n");
}
Admin Controller - Categories:
Code:
function export(){
	$this->load->helper('download');
	$csv = $this->MCats->exportCsv();
	$name = "category_export.csv";
	force_download($name,$csv);
}
CI version 2.1.2
Reply With Quote