title: MySQL transaction behavior on INSERTS
body: <p>I need to run a transaction to do "all or nothing" but I'm with some problems getting there.</p>
  
  <p>In the example bellow the 3rd INSERT fails, but I get the first two inserted. The thing is that I need to do all or nothing. Or insert all or insert none.</p>
  
  <p>How can I possibly do this in MySQL? I'm using InnoDB.</p>
  
  <pre><code>START TRANSACTION;
  insert into t_orders (id_order, date_begin, date_end) values ('1', '2012-9-08', '2012-9-16');
  insert into t_orders_items (id_order, id_order_item, id_item, item_quantity) values ('1', '1', '2', '1');
  insert into t_orders_items (id_order, id_order_item, id_item, item_quantity) values ('1', '1', '3', '1');
  COMMIT;
  </code></pre>
  
  <p>Some clues? </p>
  
  <p>Best Regards,</p>