- Moderated by:
- Support Team
-
- rank:
-
Professional
- registered:
- April 2004
- Status:
- offline
- last visit:
- 21.01.08
- Posts:
- 2723
I looked over the class, but didn't find a function for this in particular, or at least didn't recognize any as such.
In a module table that has a "hits" field (denoting pageviews) how would I grab say the 5 rows that have the highest value in this field? I could grab all the records and perform this with PHP, but the object itself seems the logical place to do it. What would be the most "compliant" way to achieve this result?
Thanks for any advice,
- John
--
Photography | PHP | Other -
- rank:
-
Professional
- registered:
- April 2004
- Status:
- offline
- last visit:
- 21.01.08
- Posts:
- 2723
I so often find that typing something out leads me to an answer ... it seems that simply by sorting by the column I need, and passing a limit, it works. :)
Code
$records = = pnModAPIFunc('ModName', 'user', 'getall', array('start'=>-1, 'limit'=>XYZ, 'order'=>'hits', 'dir'=>'desc'));
Very nice!
--
Photography | PHP | Other
