Question: how to export data from database to csv file in codeigniter?
Answer: index() - This method is a root method of this class, this method will received student data from model and send data to view file. export() - This method is received form submission request for export mysql data to CSV file. This function will write mysql data under CSV file and after file send for download.