消息:无法将类CI_DB_mysqli_result的对象转换为int(Codeigniter 3)

时间:2019-05-12 06:52:12

标签: codeigniter codeigniter-3

我只是想在CI中进行分页,这是错误

  

消息:CI_DB_mysqli_result类的对象无法转换为int

     

消息:CI_DB_mysqli_result类的对象无法转换为数字

这是我的控制人buku

{
    $data['link_admin'] = 'active';
    $config['base_url'] = base_url() . 'admin/buku/';
    $config['total_rows'] = $this->model->get_table('tbl_buku');
    $config['per_page'] = 10;
    $config['first_tag_open'] = '<li class="page-item">';
    $config['first_tag_close'] = '</li>';
    $config['last_tag_open'] = '<li class="page-item">';
    $config['last_tag_open'] = '</li>';
    $config['full_tag_open'] = '<div class="pagination pagination-sm m-0 float-right">';
    $config['full_tag_close'] = '</ul></div></div>';
    $config['num_tag_open'] = '<li class="page-item">';
    $config['num_tag_close'] = '</li>';
    $config['cur_tag_open'] = '<li class="page-item active"><a class="page-link" href="#">';
    $config['cur_tag_close'] = '</a></li>';
    $config['next_link'] = '&rarr;';
    $config['next_tag_open'] = '<li class="page-item">';
    $config['next_tag_close'] = '</li>';
    $config['prev_link'] = '&larr;';
    $config['prev_tag_open'] = '<li class="page-item">';
    $config['prev_tag_close'] = '</li>';
    $this->pagination->initialize($config);

    $data['offset'] = $this->uri->segment(3);
    $data['query'] = $this->model->get_all_paginate_book('tbl_buku', 'id', $config['per_page'], $this->uri->segment(3));
    $data['id'] = "KB".str_pad($config['total_rows']+1, 4 ,0,STR_PAD_LEFT);
    $data['kategori']    = $this->model->get_table('tbl_kategori');

    $data['title'] = "Data Buku | Perpustakaan";
    $data['title2'] = "Data Buku";
    $data['users'] = $this->db->get_where('users', ['email' => $this->session->userdata('email')])->row_array();

    $this->load->view('templates/header', $data);
    $this->load->view('templates/topsidebar', $data);
    $this->load->view('admin/buku', $data);
}

this is the view code

0 个答案:

没有答案