Welcome Guest, Not a member yet? Register   Sign In
About All Members Count?
#1
Question 
(This post was last modified: 04-22-2019, 04:45 PM by Qortizon.)

Hi,

How can I make show the total number of members registered in Codeigniter?

Model? Controller? View?
Reply
#2

@Qortizon,

You could create a model that gets the total number of members registered in Codeigniter and pass the result to the controller which passes it to the view. You could also, get the total number of members when a user first logs into the system and save the value in a session variable and call it as necessary in a controller which would make it available in any view.
Reply
#3

(This post was last modified: 04-22-2019, 09:25 PM by ciadmin.)

If you are talking about the number of registered members on the forum, that is shown in the "forum statistics" panel down the left side of the "Home" (portal) navbar link on the forum. Your intent is not clear from your question.

There are good arguments for that being in a model (retrieving data), or in a library (since you might actually model the data or data source), and a weaker one for having it in a controller (retrieving and processing the contents of a page), but I can think of no good arguments for retrieving such data in a view.
Reply
#4

Thansk for your answers.

I'm new in codeigniter.

Model:

Code:
public function get(){
      $this->db->select('gorun');
      $this->db->from('users');
      $this->db->where('gorun', '0' );
      return $this->db->count_all_results();
}

-------------------------

Controller:

Code:
public function admindash(){
      $this->load->model("admindash_model");    
      $results = $this->admindash_model->get();
}



I can't show the view. How can I do it?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB