How To Count Number Of Online Male And Female

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To Count Number Of Online Male And Female

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

    Code:
    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

    #2
    Code:
    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

    Comment


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

      Comment


        #4
        <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
        function getmenonline()
        {
        $timeout=300;$timeon=time()-$timeout;
        $males=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE sex=&#39;M&#39; AND lastact>&#39;".$timeon."&#39;"));
        return $males[0];
        }

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

        this workes fine

        Comment

        Working...
        X