Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Bagaimana cara membuat Pagination di Codeiginter?

Pengontrol:

public function all_students() 
 {      $this->load->model('loginmodel');
        $config['anchor_class'] = '';
        $config['show_count'] = true;
        $config['base_url'] = site_url('controllername/all_students');
        $config['total_rows'] = sizeof($this->loginmodel->students_list());

        $data['students_data']= $this->loginmodel->students_list();
        $data['dropdown']=      $this->loginmodel->get_degree_names();
        $config['per_page'] = 10;
        $this->jquery_pagination->initialize($config);
        $data['links'] = $this->jquery_pagination->create_links();
        $data['page'] = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
        $data['details'] = $this->loginmodel->students_list($config['per_page'], $data['page']);
        $this->load->view('all_students', $data);
    }

Model

public function students_list($limit=NULL,$start=NULL)
{


    $this->db->select('*');
    $this->db->from('student'); 

    $this->db->limit($limit,$start);                

    $query= $this->db->get();

    return $query->result();

 }


  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Apakah pengindeksan lintas tabel mungkin?

  2. Bagaimana menemukan nomor aktif dari koneksi database terbuka di H2/MySQL

  3. pilih nilai acak berdasarkan peluang probabilitas

  4. Mengapa menghubungkan ke server MySQL sangat lambat?

  5. MySQL dan PHP:UTF-8 dengan karakter Cyrillic