title: MySQL Error 1060: Duplicate column name ALTER TABLE
body: <p>I am having some problems with a query because of errors in the code that I did not create.</p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("ALTER TABLE `" . DB_PREFIX . "customer` ADD `customer_type` TINYINT(1) NOT NULL; 
  </code></pre>
  
  <p>I'm not a coder, but have so far fixed (I think) the error. By comparing with other queries that don't throw errors and reading quite a few similar posts on stackoverflow, I added a missing quote, a parenthese, and semi-colon. No more error, but not sure if this is even the correct way of doing it? I ended up with this:</p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("ALTER TABLE `" . DB_PREFIX . "customer` ADD `customer_type` TINYINT(1) NOT NULL;");
  </code></pre>
  
  <p>But now, I get a duplicate column error 1060 "duplicate column name". So I did the same thing, googled the heck out of it, search stackoverflow and found some examples using aliases and a bunch of extra lines of code which is way above my head. This code lives in side a .php file, would someone kindly hold my hand through this? You could consider it your good deed for the day! Thanks for your time.</p>