title: How to apply bindValue method in LIMIT clause?
body: <p>Here is a snapshot of my code:</p>
  
  <pre><code>$fetchPictures = $PDO-&gt;prepare("SELECT * 
      FROM pictures 
      WHERE album = :albumId 
      ORDER BY id ASC 
      LIMIT :skip, :max");
  
  $fetchPictures-&gt;bindValue(':albumId', $_GET['albumid'], PDO::PARAM_INT);
  
  if(isset($_GET['skip'])) {
      $fetchPictures-&gt;bindValue(':skip', trim($_GET['skip']), PDO::PARAM_INT);    
  } else {
      $fetchPictures-&gt;bindValue(':skip', 0, PDO::PARAM_INT);  
  }
  
  $fetchPictures-&gt;bindValue(':max', $max, PDO::PARAM_INT);
  $fetchPictures-&gt;execute() or die(print_r($fetchPictures-&gt;errorInfo()));
  $pictures = $fetchPictures-&gt;fetchAll(PDO::FETCH_ASSOC);
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <p>You have an error in your SQL syntax;
    check the manual that corresponds to
    your MySQL server version for the
    right syntax to use near ''15', 15' at
    line 1</p>
  </blockquote>
  
  <p>It seems that PDO is adding single quotes to my variables in the LIMIT part of the SQL code. I looked it up I found this bug which I think is related:
  <a href="http://bugs.php.net/bug.php?id=44639" rel="noreferrer">http://bugs.php.net/bug.php?id=44639</a></p>
  
  <p>Is that what I'm looking at? This bug has been opened since April 2008!
  What are we supposed to do in the meantime?</p>
  
  <p>I need to build some pagination, and need to make sure the data is clean, sql injection-safe, before sending the sql statement.</p>