You are almost there.
const char *sqlStatement = "UPDATE frame SET fileExist = '1' WHERE name=?";
sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL);
sqlite3_bind_text(sqlStatement, 1, variable, -1, SQLITE_TRANSIENT);
int success = sqlite3_step(sqlStatement);
sqlite3_reset(sqlStatement);
Note that preparing the SQL statement only tells SQLite what the statement looks like. He sqlite3_bind_textwho applies the variable to the SQL statement and the string sqlite3_stepthat actually runs it.
source
share