On 17 January 2011 13:00, earth <[email protected]> wrote: > I have a cakePHP application with a properties table and a > property_prices table. The price table holds property prices for > different ranges. > > properties Table > ---------------------------- > id > name > > > property_prices Table > --------------------------------- > id > property_id > date_from > date_to > price > > > I have another table property_shortlists which stores properties short > listed by a user. > > property_shortlists Table > --------------------------------------- > id > user_id > property_id > > > In a page it shows the list of shortlisted properties with a option to > sort the list base on property price. Since there is no direct > relation between the property_shortlists and property_prices table i > am having difficulty in applying the sort feature. I have tried using > unbind and bind but that did not helped.
You'll need to join the tables together so you can search them in a single query, have a read of http://book.cakephp.org/view/1047/Joining-tables Not that joins interfere with the 'contain' params, ime it's best to set contain to false and then add your fields manually to your find params. hth j -- jon bennett - www.jben.net - blog.jben.net 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
