A short explanation of a reason of this behaviour:
In MySql the default isolation level is REPEATABLE READ.
In this mode (see this link for details: click me):
All consistent reads within the same transaction read the snapshot established by the first read. This convention means that if you issue several plain (nonlocking) SELECT statements within the same transaction, these SELECT statements are consistent also with respect to each other.
In easy words: if you issue, within the same transaction, the same SELECT statement several times, you will always get the same results, regardless of changes of database made by other sessions.
The session remembers, that the first SELECT within the transaction was run at the time X and "makes the snapshot of data" at the time X, then all subsequent selects will read this snaphshot at time X, but not current data.
See next link: (click me):
If the transaction isolation level is REPEATABLE READ (the default level), all consistent reads within the same transaction read the snapshot established by the first such read in that transaction. You can get a fresher snapshot for your queries by committing the current transaction and after that issuing new queries.
By commiting the transaction (or issuing a rollback of the transaction), you end this transaction, and a next SELECT (within a new transaction) will see fresh data.
If auto_commit is enabled, then all selects are always automatically commited - so you always see fresh data.
But if you disable auto-commit, in repeatable-read (default) isolaton level, you must commit manually to see changes in the database.
Note: the above behaviour is true only for InnoDb tables. Other engines don't support ACID.