API Lite is a pretty useful tool. Is there a possibility of adding some aggregate functions? In particular I would like an Am_Lite::COUNT() for each product/subscription and for non-product users category, to give me total number of subscribers in each one.
Add this function to Lite.php, call it from your page with (for example): $active = 1; print_r(Am_Lite::getInstance()->getActiveMemberCount($active)); public function getActiveMemberCount($status) { // $status 0 : pending, 1:active, 2:expired $membercount = 0; $result = $this->query("SELECT count(*) as membercount FROM ?_user where status = $status"); $result = $result->fetch(); $membercount = $result['membercount']; // but use a foreach loop if your query returns more than a single value - plenty of examples in the Lite.php file. return $membercount; }