gpt4 book ai didi

php - 代码点火器 2.0 : Unknown column ' ' in 'where clause'

转载 作者:太空宇宙 更新时间:2023-11-03 10:59:33 25 4
gpt4 key购买 nike

我是 CI 2.0 的新手,当出现这样的错误时:

Error Number: 1054

Unknown column 'lap_jenis' in 'where clause'

SELECT * FROM (laporankebijakan) WHERE lap_type = 0 AND lap_jenis = 0 ORDER BY upd_dt desc 限制10

我的 Controller 是:

public function posts($lap_type_id=0, $lap_jenis_id=0, $offset = 0) {
if(!$this->session->userdata('login')) {
$this->session->set_flashdata('message', 'Please Relogin.');
redirect('login');
exit;
}

if(!$this->module_auth->read) {
$this->session->set_flashdata('error', $this->module_auth->msg_read);
redirect('warning');
}


$uri_segment = 4;
$num_links = 5;
$limit = 10;
$offset = $this->uri->segment($uri_segment);

$posts = $this->laporan_kebijakan_model->get_paged_list($limit, $offset, $lap_type_id, $lap_jenis_id);

$this->load->library('pagination');
$config['first_url'] = '0';
$config['base_url'] = site_url('kebijakan/posts/'.$lap_type_id);
$config['total_rows'] = $this->laporan_kebijakan_model->count_all($lap_type_id, $lap_jenis_id);
$config['per_page'] = $limit;
$config['uri_segment'] = $uri_segment;
$config['num_links'] = $num_links;
$config['cur_tag_open'] = '<span class="current">';
$config['cur_tag_close'] = '</span>';
$this->pagination->initialize($config);
$data['pagination'] = '<center><div class="pagination">'.$this->pagination->create_links().'</div></center>';

$data['current'] = 'kebijakan';
$data['lap_type_id']= $lap_type_id;
$data['lap_jenis_id']= $lap_jenis_id;
$data['posts'] = $posts;

$this->load->view('vkebijakan_admin',$data);
}

我的模型是:

    function get_paged_list($limit = 10, $offset = 0, $jenis=0){
$this->db->where('status', $jenis);
$this->db->order_by('create_date','desc');
return $this->db->get($this->tbl, $limit, $offset)->result();
}

请帮忙

最佳答案

您的表“laporankebijakan”似乎没有像“lap_jenis”这样的列。在该表中创建一个名为“lap_jenis”的列。希望错误会得到解决。

关于php - 代码点火器 2.0 : Unknown column ' ' in 'where clause' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16984593/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com