title: MySQL unique column string
body: <p>Currently I have this table in my database:</p>
  
  <pre><code>CREATE TABLE `twMCUserDB` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `mc_userName` text NOT NULL,
    `mc_userPass` text NOT NULL,
    `tw_userName` text NOT NULL,
    `tw_userPass` text NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>I want the column <code>mc_userName</code> to be unique too (just like <code>id</code>), but <code>mc_userName</code> must be a string.</p>
  
  <p>I tried to make it also a primary key, but that didn’t work.</p>
  
  <p>When I add data to the table, do I first have to check whether the <code>mc_userName</code> already exists? Or is there any built-in function in MySQL that I can use (in the insert query, or somewhere else)?</p>