hwo to retrieve data from two tables and display it in single view |
[eluser]InsiteFX[/eluser]
If he wants to use objects then all he has to do is return this from his model queries. Code: $query->result();
[eluser]jeanel16[/eluser]
oh yes it is displaying all the table data from those two tables... but when i tried to var_dump($obj); in the view inboxmsgview.php it doesn't work it said undefined variable is there other way to pass data? i think im wrong
[eluser]Abel A.[/eluser]
once you pass the object to your view you can use the object as per InsiteFX's answer, just change the name of the object.
[eluser]jeanel16[/eluser]
[quote author="InsiteFX" date="1337927049"]If he wants to use objects then all he has to do is return this from his model queries. Code: $query->result(); [/quote] yap i did that in my model return $query->result(); in my view i also did what you typed here and just fixed the braces of the foreach but it said undefined variable menudb ( im loosing hope.....
[eluser]InsiteFX[/eluser]
He he uses the way I showedhim $data['menudb'] is already an object! If he retruns a $query->result(); from his model. Code: $query->result(); // returns object CodeIgniter Users Guide - Generating Query Results
[eluser]jeanel16[/eluser]
oh i got it hahaha thanks, and im sorry im a slow learner, but i learned thanks a lot guys )))
|
Welcome Guest, Not a member yet? Register Sign In |