Php DataTable警告:table id=table-Ajax错误(DataTable.net/tn/7)

Php DataTable警告:table id=table-Ajax错误(DataTable.net/tn/7),php,mysql,codeigniter,Php,Mysql,Codeigniter,我试图在服务器端动态生成我通过internetfor首选项找到的数据表,因为在本教程中,表和列是固定的 控制器 问题是$this->customers->count\u all和count\u filtered从何而来 $this->customers->count_all() and count_filtered() 函数来自您的模型 命名 你应该检查一下你的模型,你可以找到这个函数 function count_filtered() { $this->_get

我试图在服务器端动态生成我通过internetfor首选项找到的数据表,因为在本教程中,表和列是固定的

控制器

问题是$this->customers->count\u all和count\u filtered从何而来

$this->customers->count_all() and count_filtered() 
函数来自您的模型

命名

你应该检查一下你的模型,你可以找到这个函数

 function count_filtered()
{
    $this->_get_datatables_query();
    $query = $this->db->get();
    return $query->num_rows();
}

public function count_all()
{
    $this->db->from($this->table);
    return $this->db->count_all_results();
}
我相信您正在遵循示例,非常简单的代码就在那里,只要将您的代码与该示例进行比较,我保证您的问题只会由您自己解决。因为我也用过这个例子,而且效果很好。
$this->load->model('customers_model','customers');
 function count_filtered()
{
    $this->_get_datatables_query();
    $query = $this->db->get();
    return $query->num_rows();
}

public function count_all()
{
    $this->db->from($this->table);
    return $this->db->count_all_results();
}