Fatal error: Uncaught Error: Cannot use object of type User as array

This commit is contained in:
lopar
2020-08-30 03:55:53 +03:00
parent 4d98acb9f9
commit c6ec8e8084
4 changed files with 134 additions and 172 deletions
+6 -6
View File
@@ -3,7 +3,7 @@ session_start();
if (!($_SESSION['uid'] > 0)) header("Location: index.php");
require_once 'config.php';
$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $playerId)->fetch_assoc();
$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $playerId)->fetch_object();
$can_go_ch = 0;
/*if($user['id']==1258)
@@ -17,17 +17,17 @@ $can_go_ch = 0;
}
}*/
if ($user['room'] != 49) {
if ($user->room != 49) {
header("Location: main.php");
die();
exit();
}
if ($user['battle'] != 0) {
if ($user->battle) {
header('location: fbattle.php');
die();
exit();
}
//проверяем ЦХ
if ($user['level'] >= 8 && $user['doblest'] >= 50) $can_go_ch = 1;
if ($user->level >= 8 && $user->doblest >= 50) $can_go_ch = 1;
//заходим в ЦХ
if ($_POST['c_haos']) {