I thought that does the same =3PHP Code:echo mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `online` = "1"'), 0, 0).' people online';
But also, You can just download phoenixphp/ubercms, It has also a user online counter in it?
This is a discussion on Users Online SQL within the Habbo Releases forums, part of the Habbo Hotel category; I know this is no big release but this I'm very proud of because i cant do SQL I was ...

I know this is no big release but this I'm very proud of because i cant do SQL I was just messing around with the code
This is very helpful if you want it to look different on a certain page not just [[0 user(s) online]]
Now you can have something like [[There is 0 online]]
HERE :
Also the amount of users registered (Not my work)Code:<?php $getOnline = dbquery("SELECT * FROM users WHERE online = '1'"); $Online = mysql_num_rows($getOnline) ?> <?php echo $Online; ?> [[add your custom thing such as just ONLINE]]
Don't Flame give your Opinion !Code:$getUsers = mysql_query("SELECT * FROM users"); $users = mysql_num_rows($getUsers); ?> <?php echo $users; ?> [[add your custom thing such as just REGISTERED]]
Last edited by tomsaundo; 05-11-11 at 04:49 PM.
I thought that does the same =3PHP Code:echo mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `online` = "1"'), 0, 0).' people online';
But also, You can just download phoenixphp/ubercms, It has also a user online counter in it?
In ubercms you can put %hotelstaus% (i think) and it does it automatically but this is if you want a different one
I know that the point of this release
( This is my FIRST sql attempt )
does this update when users come on and off, or do you have to reload the page?
so life is refreshing pages to see whos online.
Nice! I know this isn't a Pro release, but it is great for a beginner.
If ur using the phoenix emu then i think this query is faster, especially if ur user db is large...
so....PHP Code:SELECT users_online FROM server_status
PHP Code:<?php
$getOnline = dbquery("SELECT users_online FROM server_status");
$Online = mysql_num_rows($getOnline)
?>
<?php echo $Online; ?>
yeah i see that i should not have use the rest of his code....
the query is good though
this is how im using it in modcms
$online = $db->Execute("SELECT users_online,rooms_loaded FROM server_status");
$registerd = $db->Execute("SELECT id FROM users");
echo $online->fields['users_online']." User(s) Online | ";
echo $online->fields['rooms_loaded']." Rooms(s) Loaded | ";
echo $registerd->RecordCount()." Registered Users";
Nice simple release.
I personally use this.
All work'sCode:<?php $host = 'localhost'; $port = port; $user = 'root'; $pass = 'pw'; $db = 'dbname'; mysql_connect("{$host}:{$port}", $user, $pass); mysql_select_db($db); print mysql_result(mysql_query("SELECT COUNT(*) FROM users users WHERE users.online = '1';"), 0); ?>![]()
Nice, good for begs
Posted via Mobile Device