2017-12-16, 05:27 PM
$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 (as my previous attempts threw many errors) but it’s still wrong. Any tips? It seems to be counting all users in the usergroup instead of the totals for those that have selected male or female.