Count Male/Female Specific Usergroup
Niki Offline
Junior Member
**
Posts: 29
Joined: Oct 2016
Post: #4
RE: Count Male/Female Specific Usergroup

PHP Code:
$num_male = $db->fetch_field( $db->query( "SELECT COUNT(*) as numberofmales FROM ".TABLE_PREFIX."users WHERE usergroup = 16 ", "fid5='Male'"), 'numberofmales' );
$num_female = $db->fetch_field( $db->query( "SELECT COUNT(*) as numberoffemales FROM ".TABLE_PREFIX."users WHERE usergroup = 16 ", "fid5='Female'"), 'numberoffemales' );


So I’ve gotten to here. It works but the number of males and females is the same when it should be 2 females and 0 males.
No error anymore but it’s still wrong. Any tips? Smile

(This post was last modified: 12-16-2017 09:14 AM by Niki.)
12-16-2017 09:13 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Count Male/Female Specific Usergroup - Niki - 12-16-2017 09:13 AM

 Standard Tools
Forum Jump: