Thanks a lot! Finally I am understanding the syntax! I thought I could leave 
'first' out since it is the default. But obviously it has to be there, when 
other arguments are following.

Anja

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von David 
C. Zentgraf
Gesendet: Freitag, 5. September 2008 14:39
An: [email protected]
Betreff: Re: SQL Error: 1054: Unknown column 'conditions' in 'where clause'


> It seems my syntax for find isn't ok, but as far as I can see I follow 
> correctly

Nope, look again. The first argument either is "string $type" ('all', 'count' 
etc) or the conditions array. It is not, however, an array containing the 
conditions array. Just change that to

$hotelmaster = $this->Hotelmaster->find('first', $params);

and it should work.

Chrs,
Dav

On 5 Sep 2008, at 19:21, Liebermann, Anja Carolin wrote:

>
> Dear all,
>
> I have a function in a controller:
>
> function getHotelmaster($id)
>       {
>               $params = array(
>                       'conditions' => array('Hotelmaster.id' => $id), //array 
> of 
> conditions
>                       'recursive' => -1 //int
>               );
>               $hotelmaster = $this->Hotelmaster->find($params);
>               $this->set('hotelmaster', $hotelmaster);
>               return $hotelmaster ;
>       }
>
> Causing following error message
> SQL Error: 1054: Unknown column 'conditions' in 'where clause'
>
> When called via
> $this->data =
> $this->Hotel->requestAction('hotelmasters/getHotelmaster/'. 
> $hotelmaster_
> id);
> From another controller.
>
> It seems my syntax for find isn't ok, but as far as I can see I follow 
> correctly http://manual.cakephp.org/view/73/Retrieving-Your-Data
>
> What I want to achive is retriving my dataset without recursive 
> lookups.
>
> Anyone a hint?
>
> Thanks a lot
>
> Anja
>
> >




--~--~---------~--~----~------------~-------~--~----~
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