I am developing a Mac application that will avoid wasting data to some SQLite database. The issue is: after i close the database and open it up again, the information isn't there. Here's my code:

NSString *sql = [NSString stringWithFormat:@"INSERT INTO people(name, artist, id, album, location, cover) VALUES('%@', '%@', %d, '%@', '%@', '%@');", name, artist, ID, album, path, cover];

 sqlite3 *database = NULL;      
 sqlite3_open([[[NSBundle mainBundle] pathForResource:@"db" ofType:@"database"]
   cStringUsingEncoding:NSUTF8StringEncoding], &database);  

 sqlite3_stmt *statement;       
 sqlite3_prepare_v2(database, "CREATE TABLE IF NOT EXISTS people(name TEXT, id INT, artist TEXT, album TEXT, cover TEXT, location TEXT);", -1, &statement, NULL);   
 sqlite3_step(statement);
 sqlite3_finalize(statement);       
 sqlite3_prepare_v2(database, [sql cStringUsingEncoding:NSUTF8StringEncoding], -1, &statement, NULL);   
 sqlite3_step(statement);
 sqlite3_finalize(statement);

 statement = NULL;
 sqlite3_close(database);

This can be used code to check on your place:

sqlite3_stmt *stmt;
char *errmsg;
const char *sql = [isql cStringUsingEncoding:NSUTF8StringEncoding];

if (sqlite3_prepare_v2(database, sql, -1, &stmt, NULL) != SQLITE_OK) {
    NSLog(@"SQL Warning: Erro ao executar a instrução '%s'.", sqlite3_errmsg(database));
    sqlite3_reset(stmt);
    sqlite3_finalize(stmt);
    return;
}

if(!sqlite3_exec(database, sql, nil, &stmt, &errmsg) == SQLITE_OK) NSLog(@"SQL Warning: '%s'.", sqlite3_errmsg(database));

sqlite3_reset(stmt);
sqlite3_finalize(stmt);