title: C mysql prepared statement problems with bind
body: <p>Hello I am writing a <code>C</code> program (no C++) to push data into my <code>xampp database</code>. To program I use <code>Xcode 7.1</code></p>
  
  <p>I already got a normal query to work. So now I thought about using prepared statements.</p>
  
  <p>I already found here how to do it:
  <a href="https://stackoverflow.com/questions/7629866/how-to-setup-prepared-statements-for-mysql-queries-in-c">How to setup prepared statements for mysql queries in C?</a>  </p>
  
  <p>But my compiler does not like the code.</p>
  
  <pre><code>bind[0].buffer_type= MYSQL_TYPE_LONG;
  bind[0].buffer=ppm_value;
  bind[0].buffer_length=strlen(ppm_value);
  bind[0].is_null=0;
  bind[0].length=0;
  </code></pre>
  
  <p>It wants to replace the <code>.</code> with <code>-&gt;</code> but if I do so I get the error:</p>
  
  <pre><code>EXC_BAD_ACCESS(code=1, address=0x60)
  </code></pre>
  
  <p><code>ppm_value</code> is a <code>int</code> so I am also not sure if there is a problem with <code>strlen</code>.
  Do I even need the <code>buffer_length?</code></p>
  
  <p>Could someone please help me.</p>