From 735ad73d8b265bddb3baacffd2d164a7bcd48fca Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Mon, 28 Sep 2020 19:03:01 +0300 Subject: [PATCH] Catch db lock error. --- zayavka.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zayavka.php b/zayavka.php index 0141cbf..82369a2 100644 --- a/zayavka.php +++ b/zayavka.php @@ -10,8 +10,12 @@ if ($user->battle != 0) { header('Location: fbattle.php'); exit; } +try { + db::c()->query('LOCK TABLES `bots` WRITE, `battle` WRITE, `logs` WRITE, `users` WRITE, `inventory` WRITE, `zayavka` WRITE, `effects` WRITE, `online` WRITE, `clans` WRITE'); +} catch (Exception $e) { + echo $e->getMessage(); +} -db::c()->query('LOCK TABLES `bots` WRITE, `battle` WRITE, `logs` WRITE, `users` WRITE, `inventory` WRITE, `zayavka` WRITE, `effects` WRITE, `online` WRITE, `clans` WRITE'); $do = $_GET['do'] ?? null; if ($do == "clear" && $user->admin == 1) { db::c()->query('UPDATE `zayavka` SET `coment` = "?s" WHERE `id` = ?i', 'Вырезано цензурой!', $_GET['zid']);