<?php mysql_connect("localhost", "test_user", "test_password"); mysql_select_db("work"); //transaction begin mysql_query("BEGIN"); $sorgu1 = mysql_query("UPDATE test SET mevcut_para = mevcut_para – 10000 WHERE hesap_no = '625021'"); $sorgu2 = mysql_query("UPDATE test1 SET mevcut_para = mevcut_para + 10000 WHERE hesap_no = '124500'"); if (!$sorgu1 or !$sorgu2 ){ mysql_query("ROLLBACK"); }else{ mysql_query("COMMIT"); } ?>
0 comments:
Post a Comment