title: Transaction and commit
body: <p>Which code is right for transaction?
  do i need to check query result for commit?</p>
  
  <p>this code result nothing</p>
  
  <pre><code>mysql_query("BEGIN");
  $strSQL = "INSERT INTO table values";
  $strSQL .="('','a')";
  $objQuery1 = mysql_query($strSQL);
  $strSQL = "INSERT INTO table values";
  $strSQL .="('','a','a')";
  $objQuery2 = mysql_query($strSQL);
  if(($objQuery1) and ($objQuery2))
  {
  mysql_query("COMMIT");
  echo "Save Done.";
  }
  else
  {
  mysql_query("ROLLBACK");
  }
  ?&gt;
  </code></pre>
  
  <p>or</p>
  
  <p>this code rusult 1 insert. why?wont commit recognize the error?</p>
  
  <pre><code>  &lt;?php
      mysql_query("BEGIN");
      $strSQL = "INSERT INTO table values";
      $strSQL .="('','a')";
      $objQuery1 = mysql_query($strSQL);
      $strSQL = "INSERT INTO table values";
      $strSQL .="('','a','a')";
      $objQuery2 = mysql_query($strSQL);
      mysql_query("COMMIT");
      ?&gt;
  </code></pre>