okay. i found out:

i have three models (user, project and picture). the user_id is in the
project model and the project_id is in the picture model with this
relation:

var $hasMany = array(
                'Picture' => array(
                        'className' => 'Picture',
                        'foreignKey' => 'project_id',
                        'dependent' => false,
                        'conditions' => '',
                        'fields' => '',
                        'order' => ''
                )
        );

now i want to display the picture of a project in the user index()
view. here i get that picture query i talked about. there's no read()
code for the picture in any of the controllers! when i define a new
variable with read() in the picture controller, how can i change the
scope so i get this variable in the user controller?

thanks in advance :)

On 16 Apr., 16:13, jsundquist <[email protected]> wrote:
> Best thing to do would be to read through the blog tutorial to give
> yourself a better understanding of how that all works.  My guess is
> you did something along the lines of
> $this->Picture->id = $id;
> $this->Picture->read();
>
> If you did something like the above two lines then change it to be
> $myPicture = $this->Picture->read();
>
> Then you can use $myPicture to read out all the information stored
> with in the $myPicture which is going to be an array.
>
> On Apr 16, 9:01 am, Clemens <[email protected]> wrote:
>
> >  Hi.
>
> > I'm new to cakephp. In debug-mode i see a running queries:
>
> > SELECT `Picture`.`id`, `Picture`.`project_id`, `Picture`.`name`,
> > `Picture`.`description`, `Picture`.`type`, `Picture`.`size`,
> > `Picture`.`data`, `Picture`.`created`, `Picture`.`modified` FROM
> > `pictures` AS `Picture` WHERE `Picture`.`project_id` = (8)
>
> > How can I access this query? I want to display all db entries I can
> > find with this query!
>
> > Thanks in advance.
>
> > Best.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to