title: MySQL INSERT if not exist (not using primary key)
body: <p>how can i insert into a row if the <strong>pair</strong> does not exist?<br/>
  * NOTE these are not primary keys, my primary KEY is set to auto increment<br/><br/>
  tried insert ignore but did not work </p>
  
  <pre><code>INSERT IGNORE INTO mytable (`myid`, `theirid`) VALUES ('5', '1')
  ON DUPLICATE KEY &lt;DO NOTHING&gt;
  </code></pre>
  
  <p>table looks like:</p>
  
  <pre><code>CREATE TABLE `mytable` (
      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
      `myid` bigint(20) NOT NULL,
      `theirid` bigint(20) NOT NULL,
      `activated` tinyint(1) NOT NULL DEFAULT '0',
      `dateStamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
      PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1$$
  </code></pre>