Jump to content

users online


CBaZ

Recommended Posts

i have an issue with this

$result2 = mysql_query("SELECT COUNT(*) AS count FROM users WHERE permission = '0'");

$row = mysql_fetch_array($result2);

 

$result3 = mysql_query("SELECT COUNT(*) AS count FROM users WHERE permission = '1'");

$row2 = mysql_fetch_array($result3);

 

echo "ATM:" . ($usersOnline != 1 ? "" : "") . " $usersOnline Admin" . ($usersOnline != 1 ? "s" : "") ." / $row2[count]" . ", " . ($usersOnline != 1 ? "" : "") . " $usersOnline User" . ($usersOnline != 1 ? "s" : "") ." / $row[count]" . ". ";

 

 

permission 0 are regular users

 

permission 1 are admins.

 

for some reason the regulars are ok but admins are not.. when one person logs in it will add 2 and when more sign in the number goes up for admin and regulars something is really screwy here any ideas?

Link to comment
Share on other sites

i want it to count the 2 admin users seperately right now its throwing it all together.

 

the regulars and the admins

 

before i just had the regulars that was fine but i thought i could add the admins as well

 

 

Link to comment
Share on other sites

something like this?

 

if (permission== 1) {

echo "ATM:" . ($usersOnline != 1 ? "" : "") . " $usersOnline Admin" . ($usersOnline != 1 ? "s" : "") ." / $row2[count]" . ", "; }

else { ". ($usersOnline != 1 ? "" : "") . " $usersOnline User" . ($usersOnline != 1 ? "s" : "") ." / $row[count]" . ". "; }

 

Link to comment
Share on other sites

if (permission == 1) {

echo "ATM:" . ($usersOnline != 1 ? "" : "") . " $usersOnline Admin" . ($usersOnline != 1 ? "s" : "") ." of $row2[count]" . ", ";

} else {

echo "ATM:" . ($usersOnline != 1 ? "" : "") . " $usersOnline User" . ($usersOnline != 1 ? "s" : "") ." of $row[count]" . ". "; }

 

this produces no more admin = 0

when logged in as admin says 2 users of 26 online hmmmph

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.