• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Need some help with...

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,940
Solutions
11
Reaction score
353
So, I need some help with something like this, online players are saved into `players_online` table. I want my site to check if the player you are looking at (Search Player) is whether online or offline and post it under "Status". I'm using Avarians AAC and already tried few things, but since I'm noob at it, none of them worked x).

This might help you in udnerstanding how I want it:

PHP:
	$onl = mysql_query("SELECT * FROM `players_online` WHERE (`name` = '".$acc_sql['name'].'") ") or die(mysql_error())
	while($acc_sql = mysql_fetch_array($onl)){
		echo '<td width="100px"><center><font color="Green">Online</font></center></td>';}
else
{
		echo '<td width="100px"><center></center></td>';}

Don't laugh pls and help me ^^
 
Open the file info.php and find this line:
PHP:
echo '<tr><td width=100px>Residence:</td><td width=300px>'.$town.'<br /></td></tr>';
After, add:

PHP:
        $check_online = mysql_query("SELECT * FROM players_online WHERE name = '".$player_sql['name']."' LIMIT 1") or die(mysql_error);

        if (mysql_num_rows($check_online) == 0) {
            echo '<tr><td width=100px>Status:</td><td style="color:#FF0000;" width=300px>Offline<br /></td></tr>';
        } else {
            echo '<tr><td width=100px>Status:</td><td style="color:#00CC00;" width=300px>Online<br /></td></tr>';
        }
Post here if it don't work :)
 
Last edited:
Works fine, thanks.

@Edit:

instead of player_sql should be acc_sql :)
 
Last edited:
Back
Top