title: ALTER Query Not Working
body: <p>I have two tables: <code>cleanup</code> and <code>uniqueEntries</code>. They both have an auto-increment <code>id</code> as primary key. The table structure of <code>uniqueEntries</code> comes from <code>cleanup</code> as such:</p>
  
  <pre><code>$sql = "CREATE TABLE uniqueEntries LIKE cleanup"; //create table to store all unique entries
  doQuery($sql, "success creating uniqueEntries", "failed creating uniqueEntries"); //perform query
  </code></pre>
  
  <p>Table <code>cleanup</code> contains duplicate usernames. As I am moving data into <code>uniqueEntries</code>, I want to make sure I am not inserting any duplicates. So I need to implement an <code>ALTER</code> statement on <code>User_ID</code>. I did that as such:</p>
  
  <pre><code>$sql = "ALTER IGNORE TABLE uniqueEntries ADD UNIQUE (User_ID)"; //make User_ID unique
  doQuery($sql, "success adding constraint to uniqueEntries", "failed adding constraint to uniqueEntries"); //perform query
  </code></pre>
  
  <p>However, unlike all of my other queries the <code>ALTER</code> query does not get processed. I get <code>failed adding constraint to uniqueEntries</code>. What am I doing wrong?</p>
  
  <p>Below is my doQuery function:</p>
  
  <pre><code>function doQuery($sql, $success, $fail){
      global $conn;
          if ($conn-&gt;query($sql) === TRUE) {
          eLog( $success ); //log outcome
      } else {
          eLog( $fail ); //log outcome
      } 
  }
  </code></pre>