More of a PHP / programming development question:
I have an article that has (Category, Type, User, etc). Below the post
I want to show the related articles, but I want them to relate
together via the common attributes between articles (Category, type,
user etc).
At the moment I have a find('all') where the current articles
attributes are used, resulting in an sql query that gives at most one
or two results, as there aren't that many articles posted by the same
user in the same category of the same type. What I want is if the
number of results (findcount) is <3, remove an attribute. If it's
still less than 3, remove another attribute from the findall, and once
i have more than 3 results - stop and show those related articles.
I've been experimenting with some do-while's, mixed in with if/else
with a whole load of queries and code - just wanted to ask others on
here how they would approach it - i'm looking for a simple / elegant
solution and my brains just given up after writing an excess amount of
code and running far too many find()'s...
Thanks!
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