Posted on Sunday 13th May 2007 at 11:37 PM | |
Diablosblizz Senior Member |
Hey, I am starting to make a online part, so it shows how many users are online for the RMB Member System. So far I got it where it changes the user number to 1 when they login (so the script will know if they're in or out), and I got it to change it back to 0 when they're logged out. My problem is, when I attempt to display the users, nothing comes up. I have this code so far: PHP Code
1 2 3 4
$onine = mysql_query("SELECT username FROM members WHERE logged = '1' ORDER BY id DESC") or die (mysql_error());
Does anybody have any suggestions? Thanks! |
Posted on Monday 14th May 2007 at 01:16 AM | |
Diablosblizz Senior Member |
Fixed it myself looking over this code: PHP Code
1 2 3 4 5 6 7 8
$fetchon = mysql_fetch_array($online);
|
Posted on Monday 14th May 2007 at 01:29 AM | |
Diablosblizz Senior Member |
I know im triple posting but.. This only displays One Username at a time, and if a different user logins then it changes the username... So, how can I make it so I shows ALL of the members online. Current Code (shows only one member and it changes): PHP Code
1 2 3 4
$onine = mysql_query("SELECT username FROM members WHERE logged = '1' ORDER BY id DESC") or die (mysql_error());
Thanks! |
Posted on Monday 14th May 2007 at 04:56 AM | |
SkillMaster Senior Member |
Code $onine = mysql_query("SELECT username FROM members WHERE logged = '1' ORDER BY id DESC") or die (mysql_error()); while($fetchon = mysql_fetch_array($onine)) { $current_user_on = $fetchon['username']; echo "$current_user_on"; } That should work |