Q:

Generate CSV file using PHP Codeigniter Framework

I want to generate a csv file, using data from a database. How does one do this in PHP CodeIgniter framework?

A:

Take a look at this answer of mine and you will know exactly how you can do it.
Reports in Codeigniter
You need to use Codeigniter Database Utility Class
And need to return query instead of result_array or result

