hwo to retrieve data from two tables and display it in single view |
[eluser]jeanel16[/eluser]
I have two tables the names are menudb and msgdb, I want to select all from menudb, and also select all from msgdb then display the two table on the inboxmsgview.php I dont know how to pass two variables in the view and i know this code can not be correct no matter what i do $this->load->view(‘inboxmsgview’, $data, $data1); is it possible to pass two tables?
[eluser]InsiteFX[/eluser]
Code: $data['menudb'] = query_from_menudb; You will need to loop through the data in your view.
[eluser]jeanel16[/eluser]
I have this code in my controller Code: $this->load->model('inboxmsgmodel'); is this correct? and i dont know how to view my data on two tables in one view im sorry im new in codeigniter ![]()
[eluser]jeanel16[/eluser]
no i dont know how ![]() my task is to create a table which contains menudb id menu_name 1 inbox 2 sent 3 settings 4 reports it needs to be displayed in the view at the left side it will be a navigating link that if i click on the inbox the msgdb table will appear msgdb table id email name subject message date 1 [email protected] heidi Hello! hi! 05/25/2012 i dont know how i can make the two tables appear waaaaaaa xD
[eluser]Abel A.[/eluser]
don't know if this will work, but try it: Code: $this->load->model('inboxmsgmodel');
[eluser]jeanel16[/eluser]
then when i am in my inboxmsgview.php how can i specify if what data am i going to display? i tried var_dump($obj); to test if the object has something inside but it said undefined variable: obj
[eluser]Abel A.[/eluser]
[quote author="jeanel16" date="1337926652"]then when i am in my inboxmsgview.php how can i specify if what data am i going to display? i tried var_dump($obj); to test if the object has something inside but it said undefined variable: obj [/quote] Something is wrong with your data because it should display something when you do a var_dump. Did you tried: Code: $this->load->model('inboxmsgmodel'); |
Welcome Guest, Not a member yet? Register Sign In |