delete_order.php 591 B

1234567891011121314151617181920212223242526
  1. <?php
  2. $host = "kurek620.beget.tech";
  3. $username = "kurek620_baze";
  4. $password = "6910WASD579h";
  5. $database = "kurek620_baze";
  6. $mysql = new mysqli($host, $username, $password, $database);
  7. if($mysql->connect_error){
  8. die("Ошибка подключения". $mysql->connect_error);
  9. }
  10. $id = $_POST["id_hide"];
  11. $query = "DELETE FROM Orders1 WHERE id = $id";
  12. if ($mysql->query($query) === TRUE) {
  13. echo "<script>window.location.href = 'admin_page.php';</script>";
  14. } else {
  15. echo "Ошибка при удалении записи: " . $mysql->error;
  16. }
  17. ?>