title: PHP PDO - commit to database even there is an error
body: <p>I have a tag system designed like this:</p>
  
  <h2>tag</h2>
  
  <pre><code>CREATE TABLE `tag` (
    `tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
    `user_id` bigint(20) NOT NULL,
    `add_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`tag_id`),
    UNIQUE KEY `name` (`name`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0;
  </code></pre>
  
  <h2>user</h2>
  
  <pre><code>CREATE TABLE `user` (
    `user_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `user` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
    `email` varchar(100) COLLATE utf8_unicode_ci NOT NULL
    PRIMARY KEY (`user_id`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0;
  </code></pre>
  
  <p><code>tag.user_is</code> is a foreign key, every user can create new tag(s) if it's new(no user have been created before). My problem here with PDO commit method, it stops at the first existence of row and return this error:</p>
  
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'restaurant' for key 'name'
  </code></pre>
  
  <p>So, is there a way to tell PDO engine to continue commit even there is error?</p>
  
  <pre><code>&lt;?php
    $db-&gt;beginTransaction();
  
    for ($i = 0; $i &lt; count($tags); ++$i)
    {
      $db-&gt;execute('INSERT INTO tag(name, user_id) VALUES('.$db-&gt;quote($tags[$i]).','.$user_id.')')
    }
  
    $db-&gt;commit();
  
  ?&gt;
  </code></pre>