connect_error){ die("Ошибка подключения". $mysql->connect_error); } // Подготовка запроса для проверки логина $quary = "SELECT * FROM Users WHERE login like'$user' AND password like '$pass'"; $result = mysqli_query($mysql, $quary); $row = mysqli_fetch_assoc($result); $id = $row['id_user']; $userpass = $row['password']; $userlogin = $row['login']; $role = $row['role']; if (mysqli_num_rows($result) > 0) { if($role == 1) { session_start(); $_SESSION['id'] = $id; $_SESSION['password'] = $userpass; $_SESSION['login'] = $userlogin; $_SESSION['role'] = $role; echo ""; } else { session_start(); $_SESSION['id'] = $id; $_SESSION['password'] = $userpass; $_SESSION['login'] = $userlogin; $_SESSION['role'] = $role; echo ""; } } else { header('Location: Login.html?message=Неверные+данные'); echo ""; } // Закрытие соединения с базой данных ?>