Dear Memebers,
I wanted to make to buttons named as add / delete. when I click on the add button the value stored agianst this button should be incrementedm, and the button will be disabled after one click, but the other button is enabled, when I click on the delete button the value incremented in the add button should be decremented and the values against the deleted should be inncremented. now the delete is diabled. It means when one is enabled the other one should be disabled and the values will be incremented and decremented against buttons clicks in db.
Plz do help me in that secnario. I am not been able to build the logic what to do.
How to increment a value in db on button click using php
Moderator: General Moderators
Re: How to increment a value in db on button click using php
You can try through Ajax. On both button onclick, you can call the JavaScript function with different argument value. Based on argument value, you can disable and enable the buttons easily by JavaScript.
At the same time Ajax function can update the db count.
At the same time Ajax function can update the db count.