Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 CodeIgniter活动记录限制不存在';我不能使用MSSQL_Sql Server 2008_Codeigniter - Fatal编程技术网

Sql server 2008 CodeIgniter活动记录限制不存在';我不能使用MSSQL

Sql server 2008 CodeIgniter活动记录限制不存在';我不能使用MSSQL,sql-server-2008,codeigniter,Sql Server 2008,Codeigniter,我试图返回部分结果,我希望活动记录能够手动处理分页,因为mssql不支持偏移量。但是,下面的代码没有按预期工作 public function get_companies($search,$start,$limit) { $this->aws = $this->load->database('aws', TRUE); $this->aws->select('*'); $this->aws->from('_companies

我试图返回部分结果,我希望活动记录能够手动处理分页,因为mssql不支持偏移量。但是,下面的代码没有按预期工作

    public function get_companies($search,$start,$limit)
{
    $this->aws = $this->load->database('aws', TRUE);
    $this->aws->select('*');
    $this->aws->from('_companies');
    $this->aws->order_by("Company");
    **$this->aws->limit($start, $limit);** 
    $this->aws->like('Company', $search); 
    $query = $this->aws->get();
    return $query->result_array();
}

我已经使用limit编写了代码,它对我来说运行良好

public function get_user_list($limit=0,$offset=0)
{
    $this->db->select('*');    

    if(isset($limit)&& $limit!='')    
    {        
        $this->db->limit($limit, $offset);     
    }

    $this->db->from(USER_TABLE_NAME);    

    if(isset($condition) && $condition != '')    
    {            
        $this->db->where($condition);        
    } 

    $this->db->order_by("firstname", "asc");     
    $query = $this->db->get();    
    echo $this->db->last_query();  // To Get Whole SQL Query  
    return $query->result_array();   
}


祝您好运

来自v2.2的CodeIgniter对所有可用驱动程序100%支持
limit()
方法。

对于Mysql和MSSql,限制CI活动记录是不同的。请阅读以下内容:。也许会帮助你。