Quote:
Originally Posted by TrickyD
How can I modify this code to only count the total active subscribers in a specific subscription?
Code:
$subscribers = $db->query_first("SELECT COUNT(*) AS totalactive FROM " . TABLE_PREFIX . "subscriptionlog WHERE status=1");
$subscribers['totalactive'] = vb_number_format($subscribers['totalactive']);
I'm assuming a I need a "subscriptionid=1" in there somewhere?
|
That is correct:
PHP Code:
$subscribers = $db->query_first("SELECT COUNT(*) AS totalactivesub1 FROM " . TABLE_PREFIX . "subscriptionlog WHERE status=1 AND subscriptionid = 1");
$subscribers['totalactivesub1'] = vb_number_format($subscribers['totalactivesub1']);