a little php question

Discussion in 'Computer Science & Culture' started by Avatar, Nov 15, 2004.

Thread Status:
Not open for further replies.
  1. Avatar smoking revolver Valued Senior Member

    Messages:
    19,083
    Hi there!
    I have a code that returns results from sql database table (part of my forum database) my forum member count. So I have a forum members count on my main page. The thing is that the forum users database has a +1 additional anonymous user that must not be deleted (it counts for all the anonymous users logging in and wanting to register). The problem is that that php code retuns the member count and that additional anonymous user in the database, so I always see +1 additional user than I really have.

    the code is this (not by my hand written, I don't know php)

    Code:
    if($forumname == 'phpBB2')
      {
        if($settings[0]) // Display member count?
        {
          $countusers = $DB->query_first("SELECT COUNT(*) AS users FROM " . $tableprefix . "users");
          echo 'Foruma dalibnieki: ' . $countusers['users'] . '<br />';
        }
    how do I set that this code returns the countusers minus one value?

    thanx in advance!!
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Avatar smoking revolver Valued Senior Member

    Messages:
    19,083
    nevermind, I figured it out myself

    Please Register or Log in to view the hidden image!



    Please Register or Log in to view the hidden image!

     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Kunax Sciforums:Reality not required Registered Senior Member

    Messages:
    2,385
    hehe that was hard

    Please Register or Log in to view the hidden image!

     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. Avatar smoking revolver Valued Senior Member

    Messages:
    19,083
    hey, I suck at math and know next to nothing of php

    Please Register or Log in to view the hidden image!

     
Thread Status:
Not open for further replies.

Share This Page