Php Codeigniter-计算工作台上所有不工作的数据
你能帮我做这个吗。我试图计算我的表中有多少,因为它没有在我的视图中显示结果 控制器Php Codeigniter-计算工作台上所有不工作的数据,php,codeigniter,Php,Codeigniter,你能帮我做这个吗。我试图计算我的表中有多少,因为它没有在我的视图中显示结果 控制器 public function enrollment_summary() { $data['title'] = 'Enrollment Summary'; $this->load->model('report_model'); $data['query'] = $this->report_model->get_students(); $this-&g
public function enrollment_summary()
{
$data['title'] = 'Enrollment Summary';
$this->load->model('report_model');
$data['query'] = $this->report_model->get_students();
$this->load->view('report_enrollment_summary', $data);
}
型号
<?php
class report_model extends CI_Model
{
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function get_students()
{
$query = $this->db->count_all('students');
}
}
您的get_students()没有返回任何内容
所以你需要加上一个报税表
您当前的方法
public function get_students()
{
$query = $this->db->count_all('students');
}
变成
public function get_students()
{
$query = $this->db->count_all('students');
return $query;
}
或
public function get_students()
{
$query = $this->db->count_all('students');
return $query;
}
public function get_students()
{
return $this->db->count_all('students');
}