我正在尝试插入一些数据 sqlite 数据库...我确信插入查询是正确的,因为我从终端和 sqlite 管理器测试了它,但它不是从 ios5 插入的...请帮助!!!
-(BOOL)insertWithRawQuery:(NSString*) query
{
sqlite3_stmt *statement;
BOOL success = NO;
if (sqlite3_open([databaseFilePath UTF8String], &database) == SQLITE_OK)
{
NSLog(@"%@",query);
const char *insert_stmt = [query UTF8String];
sqlite3_prepare_v2(database, insert_stmt, -1, &statement, NULL);
if (sqlite3_step(statement) == SQLITE_DONE)
{
success=YES;
} else
{
success=NO;
NSLog(@"%d",sqlite3_step(statement));
}
sqlite3_finalize(statement);
}
sqlite3_close(database);
return success;
}
NSLog(@"%d",sqlite3_step(statement))
打印 21 这是 SQLITE_MISUSE ..你知道吗?