On Wed, Mar 16, 2011 at 12:26 PM, venky <[email protected]> wrote:
> I tried it did not work....!! Is this in TasksContorller??
yes
> What does it mean?the query would be the same except "Task.user_id" =>
> $username ...
That was incorrect, actually. Unless $username is the same as User.id.
If your tasks table has a column user_id holding the users.id value
(the PK) to associate the two records, and you pass a User.id value to
your action, you can do this:
$data = $this->Task->find(
'all',
array(
'conditions' => array(
'Task.user_id' => $user_id
)
)
);
Use debug($data) to see what is returned. It should include the
relevant User record for each Task.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php