Innodb transaction problem

Hello,
I read in the book High Performance MySQL, Second Edition that innodb transactions are reliable but its not the same case on my side. On my website i am sending three sql commands to mysql server.
2 Inserts, and one update. Innodb skip the update sql (MOST of the time, NOT all the time) and commits the transaction.

I am using set autocommit = 1 and here are mysql statements

Begin

Q1: INSERT INTO files (file_title, ‘file_date’) VALUES(‘new file’, NOW());

$id = mysql_insert_id();
Q2: UPDATE user_info SET total_media=total_media+1, file_size=$file_size WHERE id=13;
Q3: INSERT INTO keywords (file_id, keyword) VALUES ($id, ‘keyword’)

if(mysql_query->query($q1) && mysql_query($q2) && mysql_query($q3)) {

COMMIT;
}
else {
ROLLBACK;
}

Above code is just for understanding and all numeric fields are Integers.

Please help me on this.

Thanks,
Moazam

[B]Quote:[/B]
mysql_query->query
Some dataabse class?

Anyways, the error is in your code. InnoDB would not be deployed anywhere if it would not return an error if UPDATE fails.

Note that COMMIT and ROLLBACK do not have any use if autocommit=1. Read [URL]http://dev.mysql.com/doc/refman/5.1/en/commit.html[/URL]

sorry about that typo, its mysql_query, there is no code error. As far as I know commit should work with begin or start transaction.