My PHP sessions are implemented on a MySQL database, with the session table InnoDB type.
During the same execution of a PHP script, I note that a new row has been added in the session table but I'm unable to do an UPDATE statement. mysql_info() reports that there were 0 matched rows, so it never found it! But manual checks show the row exists in the table.
The thing is the UPDATE statement works if I run it in a subsequent PHP script.
It's also definitely has to do with the InnoDB type, as once switching to MyISAM, it works fine. I'm new to InnoDB table type, is there something that I need to know when dealing with InnoDB tables? row-level locking?
[Edit: There's also no errors returned by MySQL when running the UPDATE statement]
[Edit, example of SQL query]
"UPDATE session SET user_id='" . mysql_real_escape_string($user_id) . "' WHERE session_id='" . mysql_real_escape_string(session_id()) . "'";
Any help much appreciated! Thanks.