title: PDO Error - PDOException' with message 'SQLSTATE[HY000]: General error'
body: <p>I am getting this error:</p>
  
  <pre><code>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error' in ...
  </code></pre>
  
  <p>..whenever I execute this code with PDO:</p>
  
  <pre><code>//Select data from the topic.
  $s = $dbh-&gt;prepare("SELECT * FROM forum_topics WHERE forum_id=:forum_cat_id AND topic_id=:topicid");
  $s-&gt;bindParam(':forum_cat_id', $forum_cat_id);
  $s-&gt;bindParam(':topicid', $topicid);
  $s-&gt;execute();
  $f = $s-&gt;fetch();
  
  $s = $dbh-&gt;prepare("UPDATE forum_cats 
      SET 
          forum_last_postid = :last_post_id, forum_last_posttime = :time, 
          forum_last_userid = :userid, forum_last_username = :username, 
          forum_posts=forum_posts+1 
      WHERE forum_id = :forum_cat_id");
  $s-&gt;bindParam(':last_post_id', $last_post_id);
  $s-&gt;bindParam(':time', $time);
  $s-&gt;bindParam(':userid', $userid);
  $s-&gt;bindParam(':username', $userdata['username']);
  $s-&gt;bindParam(':forum_cat_id', $forum_cat_id);
  try {
      $s-&gt;execute();
  }
  catch(PDOException $e) {
      die($e-&gt;getMessage());
  }
  
  if (count($s-&gt;fetchAll()) == 0) {
      return 3;
  }
  </code></pre>
  
  <p>I have no idea why this is happening. I've checked the query, and I simply cant find any errors..</p>