title: Do MySQL transactions lock rows within InnoDB that are being updated and/or selected
body: <p>Using InnoDB, do MySQL transactions lock newly created rows when <code>BEGIN</code> is called, and then unlock them when commit is called?
  for example:</p>
  
  <pre><code>$query = "INSERT INTO employee (ssn,name,phone) 
  values ('123-45-6789','Matt','1-800-555-1212')";
  mysql_query("BEGIN");
  $result = mysql_query($query);
  mysql_query("COMMIT);
  </code></pre>
  
  <p>Does the <code>INSERT</code> statement lock that row until <code>COMMIT</code> is called, or is it rolled back to prevent other concurrent connections from modifying it?
  If not, can you only lock a row within a transactions which blocks reads and any modifications by calling select FOR UPDATE?</p>