- Joined
- May 5, 2007
- Messages
- 500
- Reaction score
- 670
Dude I did say I don't know how to do SQL I was messing around so![]()
- Martin
Great, code for a beginner. Great release.
[COLOR="red"]print mysql_num_rows(mysql_query("SELECT users_online FROM server_status"));[/COLOR]
[COLOR="red"]print mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE online = '1'"), 0);[/COLOR]
[COLOR="Red"]print mysql_num_rows(mysql_query("SELECT * FROM users WHERE online = '1'"));[/COLOR]
[COLOR="SeaGreen"]$hostname = 'localhost';
$port = 8889;
$username = 'root';
$password = 'root';
$database = 'pheonix_database';
mysql_connect("{$hostname:$port}", $username, $passord);
mysql_select_db($database);
print mysql_result(mysql_query("SELECT ss.users_online FROM server_status ss LIMIT 0,1;"), 0);[/COLOR]
I looked through this entire thread and absolutely none of this is right. Pheonix stores the array/dictionary/list/(what ever it is) of live connections in the database as positive integer. That is the most reliable online count. For the people that are doing the following:
Code:[COLOR="red"]print mysql_num_rows(mysql_query("SELECT users_online FROM server_status"));[/COLOR]
You are completely wrong. First of all this will always be "1"?
SELECT users_online,rooms_loaded FROM server_status