I think we found out what was wrong now. It seems like the way of
handling database schemas in cakephp 1.3 was quite different than in
1.1. We're having several schemas in our database.
Thanks for you taking time with my problem!

On 10 Nov, 11:25, MissYeh <[email protected]> wrote:
> What is/are the error(s)?
>
> Thefindquery should work fine. I am afraid the problem lies
> somewhere else.
>
> Though I haven't worked with PostgreSQL so maybe I am missing
> something.
>
> Can you do an simple query like:
> debug($this->Publication->find('all'));
>
> What aboutallother queries on your site? Do they work properly with
> and without the conditions?
>
> On Nov 9, 8:34 am, pearl <[email protected]> wrote:
>
>
>
> > Thanks for your reply. Unfortunately that code didn't make any
> > difference. The same error and warnings occur.
> > There are a lot of warnings about DboPostgres::fields() called in the
> > dbo_source.php file. If that sais something...
>
> > On 8 Nov, 17:30, MissYeh <[email protected]> wrote:
>
> > > hm.. not sure if my message came through. But try the following:
>
> > > $conditions99 = array("person_id" => "2", "publication_year >" =>
> > > "1994");
> > > $publications_unchecked=$this->set('publications_unchecked',$this-
>
> > > >Publication->find('all',array('conditions' =>$conditions99)));
>
> > > On Nov 8, 10:24 am, pearl <[email protected]> wrote:
>
> > > > Hi,
>
> > > > We're trying to migrate from CakePHP 1.1 to CakePHP 1.3.4 and we're
> > > > stucked! In 1.1 we're using the findAll() function and according to
> > > > the documentation you have to use this function in the following way
> > > > instead in newer versions of CakePHP:
> > > >find('all', $params);
>
> > > > I've tried this but I can't get it to work. I spent hours tofinda
> > > > solution but I haven't found anything useful yet.
>
> > > > Here is my problem:
> > > > An example from our present version (1.1) where we're using this code
> > > > for findingallin one of our controllers:
> > > >   $conditions = 'person_id =2 AND publication_year>1994';
> > > >   $this->set('publications_unchecked', $this->Publication-
>
> > > > >findAll($conditions));
>
> > > > Here's the code for the Publication model (1.1):
> > > >   class Publication extends AppModel
> > > >   {
> > > >     var $name = 'Publication';
> > > >     var $useTable ='person_item_guesses';
>
> > > >     var $belongsTo = array(
> > > >         'Tsi_item' =>
> > > >         array('className' => 'Tsi_item',
> > > >         'foreignKey' => 'item_id')
> > > >         );
> > > >    }
>
> > > > When I rewrite the code for the findAll() function in version 1.3 (see
> > > > below) I get syntax error for the SELECT statement.
>
> > > > It seems that the SELECT statement doesn't get any fields to SELECT. I
> > > > want it to be "SELECT * FROM..." but CakePHP is using this statement
> > > > instead:
> > > > SELECT  FROM "person_item_guesses" AS "Publication" LEFT JOIN "items"
> > > > AS "Tsi_item" ON ("Publication"."item_id" = "Tsi_item"."id")  WHERE
> > > > (("person_id" = 2)  AND  ("publication_year" > '1994'))
>
> > > > As you can see there is no star (*), or any fields atall, between
> > > > SELECT and FROM in the SELECT statement.
> > > > We're using a PostgreSQL database...
>
> > > > I'm using the following code forfind('all') in my controller in
> > > > version 1.3:
> > > >   $conditions99 = array("person_id" => "2", "publication_year >" =>
> > > > "1994");
> > > >   
> > > > $publications_unchecked=$this->set('publications_unchecked',$this->Publicat
> > > >  ­ion->find('all',array('conditions' =>
>
> > > > array($conditions99))));
>
> > > > I haven't done any changes in the code for the model in version 1.3.
> > > > It looks the same as in version 1.1 (see above).
>
> > > > Is there anybody out there who can see what we're missing?
>
> > > > //P- Dölj citerad text -
>
> > > - Visa citerad text -- Dölj citerad text -
>
> - Visa citerad text -

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

Reply via email to