How To Count Number Of Online Male And Female

Started on the old forum in February 2009 · view the original in the archive · old links redirect here

3 replies · 533 views · started 17 years ago · 1 min read

3 participants
dhruva Junior · 36 posts #1

how to count number of male and females online in wapdesire script . . . please can someone create function to count male and female online users

function getnummonline()
{

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE sex='M' AND lastact>'".$timeon."'"));
$num_items = $nouo[0]; //changable

}

function getnumfonline()
{

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE sex='F' AND lastact>'".$timeon."'"));
$num_items = $nouo[0]; //changable

}
/////////////////////Get members online

function getnumonline()
{
    $nouo = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online "));
    return $nouo[0];

here is the code that i created to count but its not working

looony Developer · 95 posts #2
function getnummonline()
{

$nom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE sex='M' AND lastact>'".$timeon."'"));
$num_items = $nom[0]; //changable

}

function getnumfonline()
{

$nof = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE sex='F' AND lastact>'".$timeon."'"));
$num_items = $nof[0]; //changable

}
/////////////////////Get members online

function getnumonline()
{
    $nouo = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online "));
    return $nouo[0];

try that lol

External image (may be gone)

if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }

looony Developer · 95 posts #3

you also need to change the $num_items to something difrent as all 3 off them are the same

External image (may be gone)

if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }

jsyguy23 Developer · 134 posts #4

CODE function getmenonline() { $timeout=300;$timeon=time()-$timeout; $males=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE sex='M' AND lastact>'".$timeon."'")); return $males[0]; }

function getfemonline() { $timeout=300;$timeon=time()-$timeout; $females=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE sex='F' AND lastact>'".$timeon."'")); return $females[0]; }

this workes fine

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close