4
I am finding some problems to pass the result of a query present in the model, to the view in Codeigniter. What would be the best way to do that?
My query : $query = $this->db->query("SELECT * FROM crm.usuario limit 50");
And I want to list the results in the view.
From what you said I believe you use a model based on MVC. Are you using any framework? Or have you created the structure yourself?
– Rafael Withoeft
In fact the manure has already been delivered ready to me, I was only responsible for making some changes...
– GWER
How do you render views? What do you call them?
– Rafael Withoeft
I’m sorry, I don’t understand your question... As I mentioned before, I entered this branch of programming a short time ago, and kind of directly, without taking specific courses or anything...
– GWER
Okay... I’ll try to improve the question, you are probably doing this query exactly where the executions take place to render the screen to where you want to pass this query right? Could supplement the code with the rest of the programming you have after your $query?
– Rafael Withoeft
My query is within this function present in the model ---- public Function get_online_users() { $query = $this->db->select('*') ->limit('50') ->get('usuarios.crm') ->result(); }
– GWER
Dude it’s hard to help without knowing the rest of the scope... whether or not a framework is used... if you use a.... they implement different ways to send information to the view...
– Rafael Withoeft
The structure is from Codeigniter, which uses MVC
– GWER
Remember to put tech/frameworks tags on your question so it’s easier for those who will answer or search. :)
– rray
@Okay, thanks a brother!
– GWER