title: SQLSTATE[HY000]: General error: 2053
body: <p>I am getting this error randomly in my PHP project. I am using Laravel framework. I googled around a bit and found that is an issue occurring due to PDO. I tried to log the query I am trying to run just before the error occurs and when I copy and run the same query through MySQL, it runs absolutely fine. Following is the code snippet:</p>
  
  <pre><code>foreach($batches as $batch){
          $query_post = "INSERT INTO posts (`fb_post_id`, `page_id`, `from_user_id`,`to_user_id`, ".
                          "`object_id`, `from`,`to`, `message`, `picture`,`link`, `icon`, `type`,`name`, ".
                          "`status_type`, `privacy`,`caption`, `description`,`story`, `actions`, `created_time`, ".
                          "`comment_count`,`like_count`, `created_at`) VALUES ";
          $query = '';
          foreach($batch as $row){
              $comma_separated = implode("','", $row);
              $query .= "('".$comma_separated."'),";
          }
          $query_post .= $query;
          $query_post= substr($query_post, 0, -1);
          $query_post= utf8_encode($query_post);
          Log::write('info', ' POST QUERY : '.$query_post);
          DB::query($query_post);
      }
  </code></pre>
  
  <p>After a few runs in the loop, I get the error:
  SQLSTATE[HY000]: General error: 2053 in laravel/database/connection.php line 293.
  It would be a great help if someone could give me a sound solution for it. </p>
  
  <p>P.S.: A few runs means a random number and it does not occur at some specific point. My PHP version is 5.3.10 and I have got the same error on 5.4.4 as well.</p>