Neither of the following will work:
“UPDATE choices SET votes=(votes + 1) WHERE poll_id=? && choice_id=?”
“UPDATE choices SET votes=increment(votes) WHERE poll_id=? && choice_id=?”
Thanks in advance!
Neither of the following will work:
“UPDATE choices SET votes=(votes + 1) WHERE poll_id=? && choice_id=?”
“UPDATE choices SET votes=increment(votes) WHERE poll_id=? && choice_id=?”
Thanks in advance!
votes=votes + 1
Thanks. Is that an UPDATE, SELECT, or what? As I said, I tried that (with parentheses) in an UPDATE statement, but it didn’t work.
it should work
run this code out of php
UPDATE choices SET votes=votes + 1 WHERE poll_id=? AND choice_id=?
notice the && in sql is AND
Okie doke. The “&&” never broke a statement before, but I’ll change it anyway. Thanks again!
The problem actually appears to be a defective PHP client or PDO driver. The statement executes just fine from Lita.