title: Recoverable fatal error: Object of class PDOStatement could not be converted to string in - index.php on line 23
body: <p>I am working on pagination. I want to display buttons. I am getting this type of error in my code. </p>
  
  <pre><code>Recoverable fatal error: Object of class PDOStatement could not be converted to string in C:\xampp\htdocs\blog\index.php on line 23
  </code></pre>
  
  <p>I have tried the code below - </p>
  
  <pre><code>$page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
          $limit = 10; //if you want to dispaly 10 records per page then you have to change here
          $startpoint = ($page * $limit) - $limit;
          $stmt = $db-&gt;query("SELECT articleId, articleTitle, FROM blog ORDER BY articleId DESC"); 
  
          $res=$db-&gt;query("SELECT * from {$stmt} LIMIT {$startpoint} , {$limit}");   //error in 23 line - 
  </code></pre>
  
  <p>How to fix this error?  </p>