I have a request:
Options UPDATE SET votes = votes + 1 WHERE choice_id = '$ user_choice'
But when I execute it in my script, the votes field is updated twice, so the votes will go from 4 to 6 instead of 5. No, it seems like it is called twice because I repeat the material to check this and get only one echo. Is there any way to get this, so PHP will execute this request only once on the Refresh page?
EDIT : thanks for the answers, I use regular MySQL, not MySQLi or PDO. Another thing I discovered is that when the request is executed, it works when you start at 0 and update to 1, but then after that it goes 3, 5, 7, ...
brandon
source share