diff --git a/chat.php b/chat.php index 2e906b9..746983f 100644 --- a/chat.php +++ b/chat.php @@ -11,13 +11,13 @@ if (empty($_SESSION['uid'])) { exit; } require_once "config.php"; -//include_once "functions.php"; $msg = $_POST['msg'] ?? null; -$uid = $_SESSION['uid']; +$uid = $_SESSION['uid'] ?? null; if ($msg) { - try { db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); } - catch (\Krugozor\Database\Mysql\Exception $e) { + try { + db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); + } catch (\Krugozor\Database\Mysql\Exception $e) { echo "