Select * from c4c_challenge where 1 AND challenge_id = 2 limit 1 Select * from c4c_user where 1 AND user_id = 8 limit 1 Select * from c4c_user where 1 AND user_id = 1 limit 1 set transaction isolation level serializable; start transaction; insert into c4c_match (`player1_id`,`player2_id`,`match_date`,`match_time`,`deadline_date`) values (1,8,'2008-02-14','22:00:00','2008-02-15') insert into c4c_credit_log (`activity`,`action`,`user_id`,`credit_amount`,`balance_count`,`activity_key`,`log_date`) values ('Challenge','Freeze',8,20,-20,2,'2008-02-14') insert into c4c_credit_log (`activity`,`action`,`user_id`,`credit_amount`,`balance_count`,`activity_key`,`log_date`) values ('Challenge','Freeze',1,20,-20,2,'2008-02-14') update c4c_challenge set `accepted` = 1,`match_id` = 2 WHERE 1 AND challenge_id = 2 limit 1 insert into c4c_user_match (`user_id`,`match_id`) values (8,2) insert into c4c_user_match (`user_id`,`match_id`) values (1,2) select sum(balance_count) as balance from c4c_credit_log where user_id = 1 select sum(balance_count) as balance from c4c_credit_log where user_id = 8 update c4c_user set `credit_balance` = 61 WHERE 1 AND user_id = 1 limit 1 update c4c_user set `credit_balance` = 100 WHERE 1 AND user_id = 8 limit 1 commit;