i\'m trying to update rows quantity using ajax by class not id i have looked on google for hours trying to work this out but everything i could find didnt seem to work
m
Your code is vulnerable to SQL injection.
You're using a deprecated API which does not support prepared statements to prevent SQL injection
You can combine your UPDATE
and SELECT
into a single statement. Here's an idea
Your deduction should be database based, not value based
UPDATE tbl UPDATE col = col - 1