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


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

Model? Controller? View?


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.

(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.

Thansk for your answers.

I'm new in codeigniter.


public function get(){
      $this->db->where('gorun', '0' );
      return $this->db->count_all_results();



public function admindash(){
      $results = $this->admindash_model->get();

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

Theme © iAndrew 2016 - Forum software by © MyBB