I managed to sort this out.
Changed from above to:
function index() {
$user_id = $this->Session->read('Auth.User.id');
$conditions = array('Health.user_id' => $user_id);
$this->set('healths', $this->paginate($conditions));
}
On Dec 9, 11:53 am, appel268576 <[email protected]> wrote:
> Hi guys.
>
> I have a question, I am defining my index function but I am struggling
> a bit with something.
>
> I want to have my index function only show all records in my index
> with the associated users id.
>
> How does one go about this?
>
> here is what I have:
>
> function index() {
> $conditions = $this->Health->find('first', array('conditions'
> =>
> array('Health.id' => '1')));
> $this->set('healths', $conditions, $this->paginate());
> }
>
> your reply and time is much appreciated.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en