title: SQLSTATE[HY000]: General error: 1210 Incorrect arguments to mysqld_stmt_execute
body: <p>the following code is giving me this error on a shared host where there is no value to the viewed table in db</p>
  
  <pre><code>$query = "SELECT COUNT(*) FROM viewed WHERE memberID = :memberID";
          $stmt = $db-&gt;prepare($query);
          $stmt-&gt;bindParam(':memberID', $uid, PDO::PARAM_INT);
          $stmt-&gt;execute();
          $total = $stmt-&gt;fetchColumn();    
  
  $pages = ceil($total / $per_page);
  
  $page = min($pages, filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT, array(
  'options' =&gt; array(
  'default'   =&gt; 1,
  'min_range' =&gt; 1,
  ),
  )));
  
  $offset = ($page - 1)  * $per_page; 
  
  $query = "SELECT * FROM viewed WHERE memberID = :memberID ORDER BY id DESC LIMIT :per_page OFFSET :offset";
  
           $stmt = $db-&gt;prepare($query);
           $stmt-&gt;bindParam(':per_page', $per_page, PDO::PARAM_INT);
           $stmt-&gt;bindParam(':offset', $offset, PDO::PARAM_INT);
           $stmt-&gt;bindParam(':memberID', $uid, PDO::PARAM_INT);
           $stmt-&gt;execute();
  
  $result = $stmt-&gt;fetchAll();
  </code></pre>
  
  <p>but on my config file is i remove </p>
  
  <pre><code>$db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
  </code></pre>
  
  <p>then the error disappears but without PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION how am i to know the errors?</p>
  
  <p>thanks</p>