title: PDO LIMIT and OFFSET
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2269840/php-pdo-bindvalue-in-limit">PHP PDO bindValue in LIMIT</a>  </p>
  </blockquote>
  
  
  
  <p>I could not display the data when using LIMIT and/or OFFSET in the prepare statement, but I can show "Lei Lei" if I don't use the LIMIT and OFFSET, does the code look wrong?</p>
  
  <pre><code>$statement = $conn-&gt;prepare("SELECT id,username FROM public2 WHERE username = :name LIMIT :sta OFFSET :ppage");
  $name = "Lei Lei";
  $statement-&gt;execute(array(':name' =&gt; $name,':sta' =&gt; $start,':ppage' =&gt; $per_page));
  </code></pre>
  
  <p>This have been change from the original code which worked:</p>
  
  <pre><code>$query_pag_data = "SELECT id,username from public2 LIMIT $start, $per_page";
  $result_pag_data = mysql_query($query_pag_data) or die('MySql Error' . mysql_error());
  </code></pre>