$stmt = $mysqli->prepare('SELECT `parent` FROM `'.$tbl_PRMS_inheritance.'` WHERE `child`=? LIMIT 1');
$stmt->bind_param('s', $username);
$stmt->execute();
$stmt->bind_result($userstatus);
$stmt->store_result();
$stmt->fetch();
$stmt->close();
if($userstatus=='') {$userstatus = 'Игрок';}
$stmt = $mysqli->prepare('SELECT `parent` FROM `'.$tbl_PRMS_inheritance.'` WHERE `child`=? LIMIT 1');
$stmt->bind_param('s', $username);
$stmt->execute();
$stmt->bind_result($userstatus);
$stmt->store_result();
$stmt->fetch();
$stmt->close();
if($userstatus=='') {$userstatus = 'Игрок';}
elseif($userstatus=='admin') { $userstatus = 'Администратор'; }
elseif($userstatus=='moder') { $userstatus = 'Модератор'; }
$stmt = $mysqli->prepare('SELECT `parent` FROM `'.$tbl_PRMS_inheritance.'` WHERE `child`=? LIMIT 1');
$stmt->bind_param('s', $username);
$stmt->execute();
$stmt->bind_result($userstatus);
$stmt->store_result();
$stmt->fetch();
$stmt->close();
$cyr_names = array(
'Moder' => 'Модератор',
'User' => 'Пользователь',
'Admin' => 'Администратор'
);
foreach($cyr_names as $key => $value){
if($userstatus == $key) {
$userstatus = $value;
}
}