I have 2 databases for my MMORPG. One with all the characters called (usercharacter) and one with all the accounts called (useraccount) . When we go on the profile page of the account I want to list all the characters of the account. The characters database have a table with the ID of the character, a table Account where is the name of the account that own this character. In the user database, there's a ID table and a Account table where is the name of the account. But I can't list the characters in the account, I don't know what I'm doing wrong.
personnages means characters compte means account
<?php
if(isset($_GET['action'])) {
if($_GET['action'] AND $_GET['action'] == 'personnages') {
if(isset($_POST['send'])) {
echo'<center><img src="app/Front/Images/All/loading.gif"></center>';
$Compte->ChangAvatar($_POST['avatar']);
rP('0', 'user-characters');
} else {
if($VerifChar != null) {
?>
<center>
<table id="ladder">
<tr>
<td width="180"><b><center>Name</center></b></td>
<td width="50"><b><center>Level</center></b></td>
</tr>
<?php $req = $CTB->query
("SELECT Account FROM useraccount where id = $Compte");
UNION
("SELECT Account FROM usercharacter where Account = $Compte-> select ID ORDER BY Level DESC LIMIT 0,5");
while ($Perso = $req->fetch()) { ?>
rest of the code
<tr>
<td style="background:#664338;color:#fff5dc;"><center><?php echo $Perso['Name']; ?></center></td>
<td style="background:#664338;color:#fff5dc;"><center><?php echo $Perso['Level']; ?></center></td>
<tr>
<?php } ?>
</table>