title: PDO Mysql Syntax error 1064
body: <p>I run the following code:</p>
  
  <pre><code>$conn = new PDO(....);
  .... pdo attributes ...
  
  $limitvalue = 0;
  $limit = 10;
  $sql = $conn-&gt;prepare("SELECT * FROM table1 LIMIT ?, ?");
  $sql-&gt;bindParam(1, $limitvalue, PDO::PARAM_INT);
  $sql-&gt;bindParam(2, $limit, PDO::PARAM_INT);
  $sql-&gt;execute();
  </code></pre>
  
  <p>And i get: </p>
  
  <blockquote>
    <p>Uncaught exception 'PDOException' with message 'SQLSTATE[42000]:
    Syntax error or access violation: 1064 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 'NULL, 10' at line 1'</p>
  </blockquote>
  
  <p>It happens only with this particular query. Everything else is OK.</p>
  
  <p>Btw: I know it may look stupid that i do prepared statements for "in-code" values. But it is just an example. In fact the values are depending on the page number but it doesn't matter here - this query is giving the same error too.</p>
  
  <hr>
  
  <p>If anybody is interested, the PHP version is: <strong>5.3.4RC2</strong> and MySQL's is: <strong>mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $</strong> </p>