diff --git a/enter.php b/enter.php index 66c294c..87289a8 100644 --- a/enter.php +++ b/enter.php @@ -44,9 +44,9 @@ if (!$error) { $ip = $_SERVER['REMOTE_ADDR']; db::c()->query('INSERT INTO `iplog` (`owner`, `ip`, `date`) VALUES (?i, "?s", ?i)', $data['id'], $ip, time()); - $rs = db::c()->query('SELECT * FROM `telegraph` WHERE `owner` = ?i', $data['id'])->fetch_assoc(); - while ($rs) { - addchp($rs['text'], '{[]}' . $data['login'] . '{[]}'); + $rs = db::c()->query('SELECT * FROM `telegraph` WHERE `owner` = ?i', $data['id']); + while ($res = $rs->fetch_assoc()) { + addchp($res['text'], '{[]}' . $data['login'] . '{[]}'); } db::c()->query('DELETE FROM `telegraph` WHERE `owner` = ?i', $data['id']); header("Location: fight.php"); diff --git a/inf.php b/inf.php index e30e268..3acbc20 100644 --- a/inf.php +++ b/inf.php @@ -5,7 +5,7 @@ include("functions.php"); $login = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING')); $uid = isset($_SESSION['uid'])?$_SESSION['uid']:NULL; -$user = db::c()->query('SELECT `id`,`login`,`married`,`win`,`medals`,borndate,`align`,`admin`,`realname`,`city`,`lozung`,`info`,`prof1`,`prof2`,`email`,`ip`,`exp`,`stats`,`money`,`room`,`doblest` +$user = db::c()->query('SELECT `id`,`login`,`married`,`win`,`medals`,borndate,`align`,`admin`,`realname`,`info`,`prof1`,`prof2`,`email`,`ip`,`exp`,`stats`,`money`,`room`,`doblest` FROM `users` WHERE `login` = "?s"', $login)->fetch_assoc(); $own = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = "?s"', $uid)->fetch_assoc();