Database updating wrong data

I am currently working on a fun project, which involves Ajax, HTML, Javascript, PHP and SQL.I have debugged my project as far as I could, and I am 100% sure my Ajax, HTML and Javascript are working fine and my variables are send to the server correctly.I am trying to fetch data from the database, subtract a number (submitted in the form) from this data and update the database accordingly.My database DOES update, it however is not displaying the correct numbers. When submitting 1 in the form, it will ALWAYS return the same numbers in the database. (Which is odd, because I am subtracting it....). I am 100% sure the data from the form is passed to the server correctly, so I would like you all to check my server file, which should be the problem.I'd like to thank you for your time in advance.EDIT:The database connection is made in db.php and is made correctly. This has been tested.
 
Back
Top