I am developing an ORM based on PDO, for tables that don't have unique ID fields, so when I update or delete, I need to compare to the previous values of the record, and LIMIT 1
.
When my query finally gets to the database and is executed with the parameters, everything is correct, as confirmed by the general query log, however, nothing is happening.
I get no exceptions thrown (PDO::ERRMODE_EXCEPTION
is on), and checking $stmt->errorInfo()
comes back clean, but $stmt->rowCount()
returns 0
.
As a sanity check, I opened the log file, copy and pasted the UPDATE query right into Sequel Pro (an OSX MySQL GUI) and executed, and everything worked as expected, updating 1 row.
Why does PDO not update the row, when manually executing an IDENTICAL query does?