Closed rumplin closed 3 years ago
Hi @MokraCota , You can try with $db->pdoQuery("UPDATE table SET value = value +1 WHERE id = 1");
Thank you. I am using this now. Just wanted to know if there is another way, with arrays.
PDO Class Wrapper was designed to keep noobs in mind so that they can avoid the hassle of understanding the PDO syntax. It's clean, memorable and easy to use. Hence new audience is asking to add some complex methods, I will try to serve in a very simpler way.
Hello,
how would I use the update method for incremental values?
example:
UPDATE table SET value = value +1 WHERE id = 1;
This doesn't work as expected:
$db->update("table", array("value "=>"value + 1"), array("id"=>(int)$id));
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'value + 1' for column 'value' at row 1: update - table: 711