php - syntax error in case 'remove' when decrementing -


I get a syntax error on "Delete". I was trying to fix it, but I could not understand it. Can anyone tell me how to fix it? Thanks

The code is for an online shop shopping cart

  switch ($ action) {case "add": if (isset ($ _SESSION ['train'] [ $ Id])) $ _SESSION ['cart'] [$ id] ++; And $ _SESSION ['cart'] [$ id] = 1; break; ($ $ _ Session = 'cart'] [$ id]) ($ _SESSION ['cart'] [$ id] -; (enter error if) ($ _SESSION ['cart'] [$ id] == 0 ) Unset ($ _ session ['cart'] [$ id]);) break; Case "Empty": Unset ($ _ session ['cart']); break; }   

You use brackets instead of brackets for your IF statement ($ _ Session ['cart'] [$ id]) (& lt; - $ _SESSION ['cart'] [$ id] - here

  ; (Error here) ($ _SESSION ['cart'] [$ id] == 0) Unset ($ _ session ['cart'] [$ id]);) & lt; - here    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -