Answer the question
In order to leave comments, you need to log in
Why is 1 not added to 0 in mysql?
let activ = row[0].activated
let one = 1
con.query(`UPDATE promocode SET activated = ${activ} + ${one} WHERE promo = ${promo}`)
moreover, if the number of activations in the database will be, not 0, but 1, then it will add 1 and there will be two. but if the number is 0 and it adds 1, then the number in the base remains 0.
Answer the question
In order to leave comments, you need to log in
I can advise the following query to increment the counter:
con.query(`UPDATE promocode SET activated = activated + 1 WHERE promo = ${promo}`)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question