• 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!

Solved Gesior 2012 - Pull Players Group_id from logged account

Tachi

New Member
Joined
Aug 4, 2007
Messages
376
Reaction score
2
Location
USA, Missouri
how would i get it to goto the table accounts, grab the account_id and then goto players and pull all players from said account_id and then Return highest group_id from thoes players..

Like if the account logged had 5 players, say 3 of those players are just regular players, 1 is a tutor, and 1 is a senior tutor, it would return the access of logged account's players group_id = 3.

Trying to make a commands page that will display all available commands the player can totally use.
 
PHP:
$group = (int)$SQL->query('SELECT MAX(group_id) FROM players WHERE account_id = '.$account_logged->getId())->fetchColumn();
this is how you would do it in classic gesior, not sure if $SQL or $account_logged have new names now :p
 
Nice, but it cauzed the webpage to stop working, gave server error...

Guessing 2012 gesior system changed a little bit... Anyother ideas?

BTW this is whats used to grab the group_id from the accounts table: $group_id_of_acc_logged
But i still need to grab the group_id of all players from logged account and select the highest one
 
NVM! it worked.. thanks.. This is how i set it up to work with unlogged accounts also..
Code:
<?PHP
if($logged)
{
	$group = (int)$SQL->query('SELECT MAX(group_id) FROM players WHERE account_id = '.$account_logged->getId())->fetchColumn();  
	if($group >= 3)
	{
	echo "BLAH";
	}
	else
	{
	echo "NOOO";
	}
}
else
{
echo "YOU MUST LOGIN!";
}


?>
 
Back
Top