 <p>The error is in this line of code.</p> <pre><code>if (sqlite3_prepare_v2(contactDB, query_stmt, 1, &amp;statement, NULL) == SQLITE_OK) { </code></pre> <p>The <code>1</code> is wrong. From the SQLite docs:</p> <pre><code>int sqlite3_prepare_v2( sqlite3 *db, /* Database handle */ const char *zSql, /* SQL statement, UTF-8 encoded */ int nByte, /* Maximum length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ const char **pzTail /* OUT: Pointer to unused portion of zSql */ ); If the nByte argument is less than zero, then zSql is read up to the first zero terminator. If nByte is non-negative, then it is the maximum number of bytes read from zSql. </code></pre> <p>So you are forcing SQLite to only read the first byte from the statement. Of course this is invalid.</p>