幫助,無法使用SQite中的更新。執行查詢,但xCode iOS SQLite無法正常工作
const char *dbPath=[databasePath UTF8String];
if (sqlite3_open(dbPath, &contactDB)==SQLITE_OK) {
NSLog(@"database Opened");
const char* updateQuery="update poi set test=\"111\"";
sqlite3_stmt *stmt;
if (sqlite3_prepare_v2(contactDB, updateQuery, -1, &stmt, NULL)==SQLITE_OK) {
NSLog(@"Query Executed");
}
}
sqlite3_close(contactDB);
你可以記錄錯誤,看看有什麼不對 NSLog(@「error =%s」,sqlite3_errmsg(db)); – Gago
錯誤=不是錯誤 – Andry
@Andry:檢查我的答案,你需要執行它。 –