It sounds like you could be having transaction issues since moving to InnoDB http://dev.mysql.com/doc/refman/5.0/en/innodb-transaction-model.html .
Unlike MyISAM, InnoDB supports database transactions that isolate your previous SQL commands until you have committed them with a special COMMIT
sql command. Normally, this isn't a problem since you will be running off of the same transaction on the same database connection and AUTOCOMMIT
is enabled by default. The autocommit feature of MySQL will automatically commit the transaction after a data change, such as after an UPDATE
. However, I would guess that you are connecting to the database multiple times (or perhaps using a library that is doing so) and your library or configuration is disabling autocommit.
You can test this easily by issuing the SQL COMMIT
after your UPDATE
and seeing if the problem disappears. If this is the problem, the long-term solution depends on the libraries you are using, but generally you can enable autocommit again (either through your library or by removing the disabling entry from your my.cnf or my.ini file) or you can preferably start using transactions! There are plenty of articles everywhere for "MySQL data transactions tutorial."
You can enable autocommit via PHP by executing the SQL SET AUTOCOMMIT=1;
once before executing the rest of your SQL.
This all assumes you are not having replication issues.