MySQLのロールバック機能 2008年7月14日 by mikuta テーブル形式は「InnoDB」がイイっぽい。 デフォルトでは「MyISAM」なので、 CREATE TABLE tableName ( id varchar(4), name varchar(50), PRIMARY KEY(id) ) TYPE=InnoDB; のような感じで、指定する。 既存のテーブルの変更は ALTER TABLE tableName TYPE=InnoDB; ロールバックでもどす箇所は明示的に示す。 START TRANSACTION; か BEGIN; か BEGIN WORK; そのあと、テーブル操作をごにょごにょやって、 COMMIT; (OK) ROLLBACK; (戻す) PHPでの分かりやすいサンプルがあったので、以下にメモ require_once( "db.php"