title: SQLSTATE[HY000]: General error: 1 near ".": syntax error in UPDATE statement
body: <p>I'm creating my own query-builder for practice and ran across the following problem; When invoking the <code>prepare()</code> method on a <code>PDO</code> object with the following query:</p>
  
  <pre><code>UPDATE `users` SET `users`.`name` = :usersName WHERE `id` = :id;
  </code></pre>
  
  <p>I receive the following error:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Uncaught PDOException:<br>
    SQLSTATE[HY000]: General error: 1 near ".": syntax error in ....</p>
  </blockquote>
  
  <p>I've tried this exact same SQL statement in MySQL workbench and PhpMyAdmin, both of these don't return any errors or warnings.</p>
  
  <p>The reason I'm prefixing the table name is because I'm adding up SQL <code>JOIN</code>s later on.</p>
  
  <p>Without the table prefix, it works perfectly. Without it, it looks like this:</p>
  
  <pre><code>UPDATE `users` SET `name` = :usersName WHERE `id` = :id;
  </code></pre>
  
  <p>My PHP file looks like this:</p>
  
  <pre><code>&lt;?php
      $statement = "UPDATE `users` SET `users`.`name` = :usersName WHERE `id` = :id;";
  
      $PDO = new PDO('sqlite::memory:');
      $PDO-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $PDO-&gt;exec("CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(50))");
      $PDO-&gt;exec("INSERT INTO `users` (id, name) VALUES (1, 'Bas')");
      $PDO-&gt;exec("INSERT INTO `users` (id, name) VALUES (2, 'Basert')");
  
      $statement = $PDO-&gt;prepare($statement);
  </code></pre>
  
  <p>The error occurs after that line.</p>
  
  <p>Why does this syntax error occur and how can I fix it without removing the table prefix?</p>