title: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; PDO
body: <p>I am writing some software right now. Reader's digest version: users select a package, and enter their name, email, and desired subdomain. A subdomain is then checked to see if someone already registered it and if it is only alphanumeric. I had all of this working using MySQL, but I have decided to make the move to PDO.</p>
  <p>The exact wording of the error:</p>
  <p><a href="https://i.stack.imgur.com/wSEXP.png" rel="nofollow noreferrer">error</a></p>
  <p>The stack trace is all over the place, and I can barely figure out when to begin troubleshooting this. I have checked the other answers here, and they all seem too localized, so here's the code that produces it, then all of the methods that contain errors. Here we go...</p>
  <p>migrate_1401_04_22_12_03_00_users.php</p>
  <pre><code>public function up()
  {
      $db = Application::$app-&gt;database;
      $sql = &quot;CREATE TABLE users (
          id INT AUTO_INCREMENT PRIMARY KEY,
          name(255) NOT NULL,
          first_name(255) NOT NULL,
          last_name(255) NOT NULL,
          email(255) NOT NULL,
          password(255) NOT NULL,
          status TINYINT NOT NULL,
          created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
      )  ENGINE=INNODB;&quot;;
      $db-&gt;pdo-&gt;exec($sql);
  }
  </code></pre>