0

我收到一个数据库错误,即Error Number: 1054

' IS NULL LIMIT 15''where 子句'中的 未知列SELECT * FROM (categories) WHERE IS NULL LIMIT 15

function categories()
{   

    $this->suri=3;
    $this->surl=site_url('variables/categories/');
    $this->load->library('pagination');
    $cond = array(
                'parent_id' => '0'
                );
    $config['base_url'] = $this->surl;
    $config['total_rows'] = $this->commonmodel->getcountcond('categories',$cond);
    $config['per_page'] = '15';
    $config['first_link'] = 'First';
    $config['last_link'] = 'Last';
    $config['cur_tag_open'] = '<span>';
    $config['cur_tag_close'] = '</span>';
    $config['uri_segment'] = $this->suri; 
    $this->pagination->initialize($config);
    $parent_cond = array(
                'parent_id' => '0'
                 );
4

2 回答 2

1

我认为您的查询必须是:
您的 where 子句中必须有一个参考字段

SELECT * FROM (categories) WHERE `categories.field` IS NULL LIMIT 15
于 2012-10-29T07:19:58.803 回答
0
$this->commonmodel->getcountcond('categories',$cond);

这个计数器不起作用..检查它;)

于 2012-10-29T07:21:29.907 回答