title: C++ SQLite3 Bind-Blob Not Working As Expected
body: <p>I have an image stored in memory as a two dimensional array of unsigned shorts and am able to write the image out to file without issue, I am however trying to save the image as a blob directly to my SQLite database using bind-blob and prepared statements, however following other examples I've seen don't seem to be working for me.</p>
  
  <p>I've created my table successfully using the following query:</p>
  
  <p>CREATE TABLE ImageData (Data Blob)</p>
  
  <pre><code>static int imgSize=1000;
  static unsigned short *image=new unsigned short[imgSize];
  sqlite3 *db;
  sqlite3_stmt *stmt;
  char *tail;
  char * sql = "INSERT INTO SongLoopData (Data) VALUES ( ? )";
  sqlite3_open("imageDB.db", &amp;db);
  
  (sqlite3_prepare_v2(db, sql, -1, &amp;stmt, NULL));
  sqlite3_bind_blob(stmt, 1, image, imgSize*sizeof(unsigned short), SQLITE_STATIC);
  
      sqlite3_finalize(stmt);
  
      sqlite3_close(db);
  }
  </code></pre>
  
  <p>I would expect that this would be enough to pass the image into my database, but it doesn't actually pass anything at all and doesn't return any console errors either.  I'm sure I'm doing something silly but am struggling to figure it out myself.</p>