hi paul,
thanks for your help...
now i have been trying to combine your code with with conditions i
need for my query:
$moreLinks = $this->Link->find('all', array(
'contain' => your code......,
'conditions' => array('Link.created < \''.$lastLink.'\'
AND Link.fk_user_id = \''.$id.'\''),
'order' => 'Link.created DESC',
'limit' => 1
));
i dont get an error, the query just wont consider the conditions. but
the syntax is acutally correct and works if i do it this way:
$moreLink = $this->Link>find('all',
array('conditions' => 'Link.created < \''.
$lastLink.'\' AND Link.fk_user_id = \''.$id.'\' ORDER BY Link.created
DESC', 'limit' => 2));
so its gotta be structure thing and how i put the conditions array in
the find method...
sorry to bother again, but i am stuck again....its driving me nuts
thx :)
On 7 Nov., 10:31, WebbedIT <[email protected]> wrote:
> $this->link->find('all', array('contain'=>array('Icon')));
>
> HTH, Paul.
>
> On Nov 6, 5:16 pm, Tomfox Wiranata <[email protected]> wrote:
>
>
>
>
>
>
>
> > hi everyone,
>
> > i want to apply the contain function but i cant get it to work. so
> > this is my find in the users_ controller :
>
> > $this->Link-> find('all', conditions etc.);
>
> > now debugging this find method shows that cake returns the result as
> > this:
>
> > Array
> > (
> > [0] => Array
> > (
> > [Link] => Array
> > (
> > [fk_user_id] => 76
> > [title] => Rot
> > [description] =>
> > [created] => 2011-10-30 16:40:33
> > [hash] => a872ca5c991cfa388d0ac29c78c09
> > [date_locked] =>
> > [id] => 214
> > [locked] =>
> > [parent_id] =>
> > [number_ratings] => 0
> > [average_rating] =>
> > [average_rating_rounded] =>
> > [rating_lastvoted] =>
> > )
>
> > [User] => Array
> > (
> > [username] => ma
> > [firstname] => Ma
> > [lastname] => W
> > [hash] => a707e9e245888cd65ccc5a6984124200
> > [id] => 76
> > )
>
> > [Parent] => Array
> > (
> > [fk_user_id] =>
> > [title] =>
> > [description] =>
> > [created] =>
> > [hash] =>
> > [date_locked] =>
> > [id] =>
> > [locked] =>
> > [parent_id] =>
> > [number_ratings] => 0
> > [average_rating] =>
> > [average_rating_rounded] =>
> > [rating_lastvoted] =>
> > )
>
> > [Settings] => Array
> > (
> > [id] =>
> > [color_headline] =>
> > [color_headline_background] =>
> > [color_background] =>
> > [fk_link_id] =>
> > )
>
> > MORE code here......
>
> > all i need from this data is the [Link] array and the [Icon] array...
> > this is so depressing cause i tried dozens of combinations....
>
> > so how do i do this? $this-> link-> contain.........
>
> > appreciate it :)
--
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