title: PHP PDO prepared statement string length limit
body: <p>I have a problem where the resulting prepared string is being limited in length:</p>
  
  <p>My SQL statement goes like this:</p>
  
  <pre><code>INSERT INTO `empresa`
      (`nombre`, `calle`, `colonia`, `ciudad`, `estado`, `pais` `codigo_postal`, `telefono`, `email`)
      VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
  </code></pre>
  
  <p>And it doesn't matter if I bind the values using <code>bindParam()</code>, <code>bindValue()</code> or even at the <code>execute()</code>, it's always trimmed at a certain lenght and I get this error:</p>
  
  <blockquote>
    <p>Syntax error or access violation: 1064</p>
  </blockquote>
  
  <p>And it complains about…</p>
  
  <blockquote>
    <p>the right syntax to use near '<code>codigo_postal</code>, <code>telefono</code>, <code>email</code>) VALUES ('algo', '1', '7', 'b', 'ha' at line 2'</p>
  </blockquote>
  
  <p>If I reduce the parameters in length, say, to make <code>'algo'</code> only <code>'al'</code>, the error is the same but <code>'ha'</code> is shown up to <code>'hasd'</code>, if I specify only one or two colums so the complete statement is shorter it's executed correctly. What can I do? A workaround is performing an <code>INSERT</code> and then <em>updating</em> its fields with another statements, but that's just silly.</p>