here is my code:
    function download1() {
    $this->load->dbutil();
    $this->load->helper('file');
    $this->load->helper('download');
    $delimiter = ",";
    $newline = "\r\n";
    $filename = "filename_you_wish.csv";
    $query = $this->db->query("SELECT TABLE_NAME 
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA='sample_db'");
    $res = $query->result_array();
    foreach ($res as $row):
        $filename = $row['TABLE_NAME'] . '.csv';
        $q = "select * from " . $row['TABLE_NAME'];
        $result = $this->db->query($q);
        $data = $this->dbutil->csv_from_result($result,$delimiter,$newline);
        force_download($filename, $data);
    endforeach;
    }
It just downloads th first table and no more. i want all the tables to download.
