//用问号形式插入数据
-(void) insertRecord:(NSString *)table
withValue1:(NSString*) value1
withValue2:(NSString*) value2
withValue3:(NSString*) value3
{
NSString * sql = [NSStringstringWithFormat:@"insert into members('name','email','birthday') values (?,?,?)"];
sqlite3_stmt *statement;
if(sqlite3_prepare_v2(db, [sqlUTF8String], -1, &statement,nil) ==SQLITE_OK){
sqlite3_bind_text(statement,1, [value1 UTF8String], -1,NULL);
sqlite3_bind_text(statement,2, [value2 UTF8String], -1,NULL);
sqlite3_bind_text(statement,3, [value3 UTF8String], -1,NULL);
}
if (sqlite3_step(statement) !=SQLITE_DONE) {
NSAssert(0,@"插入数据失败");
}
sqlite3_finalize(statement);
}
SQLITE_APIint sqlite3_bind_blob(sqlite3_stmt*,int,const void*,int n, void(*)(void*));
SQLITE_APIint sqlite3_bind_double(sqlite3_stmt*,int,double);
SQLITE_APIint sqlite3_bind_int(sqlite3_stmt*,int,int);
SQLITE_APIint sqlite3_bind_int64(sqlite3_stmt*,int,sqlite3_int64);
SQLITE_APIint sqlite3_bind_null(sqlite3_stmt*,int);
SQLITE_APIint sqlite3_bind_text(sqlite3_stmt*,int,const char*,int n, void(*)(void*));
SQLITE_APIint sqlite3_bind_text16(sqlite3_stmt*,int,const void*,int, void(*)(void*));
SQLITE_APIint sqlite3_bind_value(sqlite3_stmt*,int,const sqlite3_value*);
SQLITE_APIint sqlite3_bind_zeroblob(sqlite3_stmt*,int,int n);