12345678910111213141516171819202122232425262728 |
- <?php
- $host = "kurek620.beget.tech";
- $username = "kurek620_baze";
- $password = "6910WASD579h";
- $database = "kurek620_baze";
- $mysql = new mysqli($host, $username, $password, $database);
- if($mysql->connect_error){
- die("Ошибка подключения". $mysql->connect_error);
- }
- $setting = $_POST["hide_c"];
- $product_id = $_POST["hide_pr"];
- $query = "UPDATE Products SET count_p = count_p - $setting WHERE id = $product_id";
- $result = $mysql->query($query);
- if(!$result){
- echo "Что то не так" . $mysql->error;
- }
- else{
- echo "<script>window.location.href = 'admin_page.php';</script>";
- }
- ?>
|