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 to find a
> 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 finding all in 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 at all, between
> SELECT and FROM in the SELECT statement.
> We're using a PostgreSQL database...
>
> I'm using the following code for find('all') in my controller in
> version 1.3:
>   $conditions99 = array("person_id" => "2", "publication_year >" =>
> "1994");
>   
> $publications_unchecked=$this->set('publications_unchecked',$this->Publication->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

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