title: How to prepare sql statements and bind parameters?
body: <p>Unfortunatelly, the <a href="http://www.sqlite.org" rel="noreferrer">documentation</a> completely lacks examples (what is really strange), as if it assumes all its readers to be good programmers. Whereas, I'm quite new to <code>C++</code> and can not really figure out from the documentation how to really prepare and execute statements. I love the way how it is implemented in <code>PDO</code> for <code>PHP</code>. Normally, I just do it like this:</p>
  
  <pre><code>$s = $db-&gt;prepare("SELECT id FROM mytable WHERE id = :id");
  $s-&gt;bindParam(':id', $id);
  $s-&gt;execute();
  </code></pre>
  
  <p>or do it using <code>?</code> tokens:</p>
  
  <pre><code> $data = array();
   $data[] = 1;
   $data[] = 2;
   $s = $db-&gt;prepare("SELECT id FROM mytable WHERE id = ? or id = ?");
   $s-&gt;execute($data);
  </code></pre>
  
  <p>Now, I have <code>C++</code> and <code>sqlite3.h</code> in my hands. At this moment, I know just how to connect to database - I do it and get no errors:</p>
  
  <pre><code>sqlite3 * conn;
  int rc = sqlite3_open(db_name, &amp;conn);
  </code></pre>
  
  <p>Please, give some instructions (with clear tiny examples) about how to implement similar things that <code>PDO</code> does in <code>PHP</code> - prepare a statement using named arguments and using <code>?</code> tokens.</p>