#import <sqlite3.h>
sqlite3 *db;
sqlite3_open("data.db", &db);
//parameters protect from SQL injection
sqlite3_stmt *stmt;
sqlite3_prepare_v2(db,
"select name from lines where id = ?",
-1, &stmt, NULL);
sqlite3_bind_int(stmt, 1, 1);
if (sqlite3_step(stmt) == SQLITE_ROW) {
const char *name = (const char *)
sqlite3_column_text(stmt, 0);
//name is "one"
}
sqlite3_finalize(stmt);
sqlite3_close(db);