Welcome Guest, Not a member yet? Register   Sign In
view calling a model?
#11

[eluser]sanct_arvin[/eluser]
$load->model('some_model','',TRUE)????

it won't load if i use $this.
i'm such a noob
#12

[eluser]wiredesignz[/eluser]
I don't agree with loading a model inside a view, but you can pass a reference to the model as a variable to the view.

Code:
//controller
$this->load->model('Some_Model','some_model', TRUE);

$data['some_model'] =& $this->some_model;

$this->load->view('Some_View', $data);
#13

[eluser]sanct_arvin[/eluser]
thx for this.

i'm totally clueless how to load two queries in one page.
thats my real problem.

the first query would be independent
and then the secodn one is depended from the first query.
#14

[eluser]Sumon[/eluser]
So finally would you(wiredesignz) please write a fresh example copy of model, view and controller. Please
#15

[eluser]wiredesignz[/eluser]
Sorry Sumon, I'm not able to provide a tutorial, I'm sure you will manage to work it out for yourself.
#16

[eluser]Xavier D.[/eluser]
I am having the same problem.

I am creating a pm box, I need to have the user_id, no problem, is stored in userdata session with authorization, but I also need to have the contact id and his details, that is the second query, how do we solve this whitout calling the model in te view?

So I have model that returns the user details (no problem), but I also need the contact id to get his details.

pm row stored in $data['pm_message'] contact id is insite ... multiple rows

[EDIT] problem solved, just make a join ... stupid mistake Smile




Theme © iAndrew 2016 - Forum software by © MyBB