Click here to Skip to main content
15,793,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I make a download function to download pdf based on filename that has already inserted on database and this is my function:
function download($offset=0,$order_column='judul',$order_type='asc'){
        if(empty($offset)) $offset=0;
        if(empty($order_column)) $order_column='judul';
        if(empty($order_type)) $order_type='asc';
        //load data
        foreach ($data as $row)
            $name = 'download.pdf';


these are my models:
function semua($limit=10,$offset=0,$order_column='',$order_type='asc'){
        // $db1 = $this->load->database('default',TRUE);
        if(empty($order_column) || empty($order_type))
        return $this->db->get($this->table,$limit,$offset);

function jumlah(){
        return $this->db->count_all($this->table);

the problem is the file that I downloaded is always the first pdf name from database
can you help me fix my code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900