Welcome Guest, Not a member yet? Register   Sign In
Loop inside a loop in controller.. help needed....:(
#8

[eluser]Roy MJ[/eluser]
I was thinking of a way where i can call anothr function in the model but im still a starter in codeigniter and i dun have the depth in this.

In controller
Code:
$this->data['friends']=$this->Friends_model->select_friends($config['per_page'],$pgoffset,$id);

And the model for this wud be to just get friends id from table friends.

So that the details of friends can be got from another function in model. But that means ill have to pass the data as loop in the controller.

Like

Code:
foreach($this->['friends']){
$this->data['friends_details']=$this->Friends_model->select_friends_details(friends->$friend);
}

This is just an idea am i dunno whether its correct. Im a bit afraid cuz ill have to change the entire thing and the due date is up.. Sad


Messages In This Thread
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-03-2011, 11:21 PM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-03-2011, 11:28 PM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-04-2011, 12:19 AM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-04-2011, 01:07 AM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-04-2011, 11:59 PM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-05-2011, 12:12 AM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-05-2011, 12:22 AM
Loop inside a loop in controller.. help needed....:( - by El Forum - 04-05-2011, 12:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB