Undefined index: battle, in_tower. Mysql::query: Unknown column 'real_time' in 'where clause'.

This commit is contained in:
Igor Barkov (iwork) 2020-07-06 16:54:51 +03:00
parent 3ca97c3bad
commit c6efca652d
1 changed files with 20 additions and 13 deletions

View File

@ -1,7 +1,6 @@
<?php
ob_start("ob_gzhandler");
session_start();
$errkom = '';
$get = filter_input(INPUT_SERVER, 'QUERY_STRING');
if ($get === 'exit') {
session_destroy();
@ -17,13 +16,21 @@ $tmaz = time();
try {
db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `user_id` = ?i', time(), $user['id']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
//echo "<div style='background-color: #ffaaaa;'>Ошибка: " . $e->getMessage() . "<br> В файле: " . $e->getFile() . " (" . $e->getLine() . ")</div>";
echo "<div style='background-color: #ffaaaa;'>Ошибка: " . $e->getMessage() . "<br> В файле: " . $e->getTraceAsString() . " (" . $e->getLine() . ")</div>";
}
if ($user['battle'] != 0) {
header('location: fbattle.php');
die();
echo "<div class='debug' '>Ошибка: " . $e->getMessage() . "<br> Стек: " . $e->getTraceAsString() . "</div>";
}
try {
if ($user['battle'] != 0) {
header('location: fbattle.php');
die();
}
} catch (Exception $e) {echo '<div class="debug">Не подтянулся $user[\'battle\'], нет ячейки в базе.</div>';}
try {
//БС
if ($user['in_tower'] == 1) {
header('Location: towerin.php');
die();
}
} catch (Exception $e) {echo '<div class="debug">Не подтянулся $user[\'in_tower\'], нет ячейки в базе.</div>';}
/* === проверяем соответствие комнаты и скрипта === */
if (in_array($user['room'], [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) {
@ -103,11 +110,7 @@ if ($user['room'] == 650) {
header('Location: ul_clans.php');
die();
}
//БС
if ($user['in_tower'] == 1) {
header('Location: towerin.php');
die();
}
//Храм древнх
if ($user['room'] == 203) {
header('Location: church.php');
@ -1689,7 +1692,11 @@ if (input::get('edit')) {
<title></title>
</HEAD>
<body onLoad="<?= topsethp(); ?>">
<?php $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60)); ?>
<?php
try {
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
} catch (Exception $e) {echo '<div class="debug">В таблице online нет ячейки real_time так как неясно что она делает. Ошибка обращения в базу.</div>';
?>
<div id=hint3 class=ahint></div>
<table class="allzeroes">
<tr>