You should not use the query function except for incredibly complex
queries.

CakePHP 1.3 introduced the virtualFields parameter to help with this
exact problem.

Do:

$this->Question->virtualFields = array(
  'maxQSet' => 'max(qset'),
);

$max = $this->Question->find('first', array('fields' => array(
        'maxQSet',
    ),
    'conditions' => array(
        'Question.category_id' => $this->Session->read('categoryid'),
    ),
));

You also don't give enough information to help solve your problem.
What errors do you get, what does your sql dump look like, have you
saved 'categoryid' into your session vars, have you included the
Session component in your controller, etc...

If you'd like some real time help you should join the IRC channel on
freenode. Or you can try asking your question on the cakeqs.org site
which is much nicer than this Google Group.

On Aug 29, 6:32 am, Muthuvel Subramani <jmsmuthu...@gmail.com> wrote:
> Thanks for the reply...

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to