title: pg_query(): Query failed: ERROR: column "x" does not exist LINE 2: SET name=x
body: <p>I have been working on something like a sign up form for a facebook app but instead of INSERT it UPDATE because before that I have already INSERT</p>
  
  <pre><code>$inserP = "INSERT INTO particular (id, name)
  VALUES ($userid, 0)";
  pg_query($conn, $inserP);
  </code></pre>
  
  <p>and I come across this error after submitting the form with the username tom:</p>
  
  <pre><code>pg_query(): Query failed: ERROR: column "tom" does not exist LINE 2: SET name=tom
  </code></pre>
  
  <p>Here is my form</p>
  
  <pre><code>&lt;form action="update.php" method="post"&gt;
  &lt;input type="text" name="username" id="username" autocomplete="off" /&gt; 
  &lt;input type="image" name="confirm" src="/images/confirm.png"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my update.php</p>
  
  <pre><code>require('conn.php');
  require('getfacebookapi.php');
  $userid = idx($facebook-&gt;api('/me/'), 'id', string);
  $username=$_POST['username'];
  $pszz = "UPDATE particular
  SET name=$username
  WHERE id=$userid";
    if(preg_match("/^[a-zA-Z]+$/", $username)) {       
      pg_query($conn, $pszz);}
  </code></pre>
  
  <p>There is absolutely nothing wrong with my pg_pconnect.. Can someone tell me where I went wrong and how to fix this error? I'm new to both php and sql... Thanks!!</p>