In CodeIgniter we can export data easily from database as CSV using a library called dbutil.