У анкеты было отдельное подключение к БД.

This commit is contained in:
lopar 2020-10-27 21:51:49 +02:00
parent 5a60b25b04
commit 7fe8318472

View File

@ -10,11 +10,6 @@ if ($user->battle) {
exit();
}
use Krugozor\Database\Mysql\Mysql as Mysql;
$db = Mysql::create("192.168.20.100", "battles", "bottle-neck-horse")
->setDatabaseName("battles")
->setCharset("utf8");
define('INFO_CHAR_LIMIT', 1500);
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
$oldpsw = filter_input(INPUT_POST, 'oldpsw', FILTER_SANITIZE_SPECIAL_CHARS);
@ -42,7 +37,7 @@ if ($name || $color || $hobbie) {
err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!');
} else {
$values = ['realname' => $name, 'color' => $color, 'info' => $hobbie];
$db->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id);
db::c()->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id);
}
}