Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. elseif($_GET['action'] == 'update') {
  2.         if(empty($_SESSION['cart']) || !isset($_SESSION['cart'])) { echo 'Cos poszlo zle'; } else {
  3.                     foreach($_SESSION['cart'] as $key=>$item) {
  4.                         $realqty = $item['qty'] - 1;
  5.                         mysqli_query($conn, "UPDATE items SET qty = '".$realqty."' WHERE product_index = '".$item['index']."';");
  6.                     }
  7.                     unset($_SESSION['cart']);
  8.                 }
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement