update_order.php 652 B

12345678910111213141516171819202122232425262728
  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. $setting = $_POST["hide_c"];
  11. $product_id = $_POST["hide_pr"];
  12. $query = "UPDATE Products SET count_p = count_p - $setting WHERE id = $product_id";
  13. $result = $mysql->query($query);
  14. if(!$result){
  15. echo "Что то не так" . $mysql->error;
  16. }
  17. else{
  18. echo "<script>window.location.href = 'admin_page.php';</script>";
  19. }
  20. ?>