nomanoma Posted April 22, 2009 Share Posted April 22, 2009 hi: i have a website that has 3 types or memberships. i can get my site to show all members count by this: $count= mysql_query("select * from members WHERE verified=1"); $rowcount = @mysql_num_rows($count); what i want is to show the member count of each type separately. i'm new to php, so please can anyone help? noma Quote Link to comment https://forums.phpfreaks.com/topic/155256-solved-different-types-of-members-count/ Share on other sites More sharing options...
Maq Posted April 22, 2009 Share Posted April 22, 2009 You have to use COUNT() and GROUP BY to accomplish this. Quote Link to comment https://forums.phpfreaks.com/topic/155256-solved-different-types-of-members-count/#findComment-816840 Share on other sites More sharing options...
fenway Posted April 23, 2009 Share Posted April 23, 2009 As in: select memberType, COUNT(*) as cnt from members WHERE verified=1 GROUP BY memberType Quote Link to comment https://forums.phpfreaks.com/topic/155256-solved-different-types-of-members-count/#findComment-817416 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.