I have a form in that i am getting the initial value of form from mysql and then javascript changes the value (every second that value increases by 1 ) but when i submit the form it submits the initial value what i have got from mysql .
please tell how to submit the updated value for example if i have retrieved 40 as form value from MySQL then it keeps on increasing but as in form value is coming from MySQL when i submit it submits 40 only but in actual my form value increases every second please tell how to submit updated value in MySQL. here is my code.
I realized your problem: You are fetching the value before the
UPDATE, so you are always getting the old value. Make sure you run theSELECTafter theUPDATEso you can get the new value. Try something like this:So, it was nothing to do with the
$_POSTvalue, the value that you used to repopulate the form input from the database was “old”. There’s plenty of other things I could nitpick about the code, and I’m tempted to, but this should get you moving forward.