????????FMDB
???????????? ???????[ 2014/5/13 15:25:10 ] ???????????????? FMDB
????3.???????????????????
NSString *sql1 = @"create table bulktest1 (id integer primary key autoincrement?? x text);"
"create table bulktest2 (id integer primary key autoincrement?? y text);"
"create table bulktest3 (id integer primary key autoincrement?? z text);"
"insert into bulktest1 (x) values ('XXX');"
"insert into bulktest2 (y) values ('YYY');"
"insert into bulktest3 (z) values ('ZZZ');";
[dataBase executeStatements:sql1];
|
??????????????????????????????
????NSArray *stuentInfo = [NSArray arrayWithObjects:@"?????"??@"213"??@"123456@qq.com"?? nil nil];
????[dataBase executeUpdate:@"insert into student (name?? password?? email) values (???????)" withArgumentsInArray:stuentInfo];
????4.??????????????
????NSString *sqlInsert = @"INSERT INTO student (name?? password?? email) values (???????)";
????BOOL flag = [dataBase executeUpdate:sqlInsert?? @"????"?? @"123"?? @"654321@qq.com"];
????NSLog(@"%d"?? flag);
????5.1.???????????
????FMResultSet *result = [dataBase executeQuery:@"SELECT * FROM student"];
????[self showInfo:result];
????[result close];
- (void)showInfo:(FMResultSet *)result
{
while ([result next]) {
int _id = [result intForColumnIndex:0];
NSLog(@"id : %d"?? _id);
NSString *name = [result stringForColumnIndex:1];
NSLog(@"name : %@"?? name);
NSString *password = [result stringForColumnIndex:2];
NSLog(@"password : %@"?? password);
NSString *email = [result stringForColumnIndex:3];
NSLog(@"email : %@"?? email);
}
}
|
????5.2.?????????
????NSString *sqlInsert = @"SELECT * from student where name = %@";
????FMResultSet *result = [dataBase executeQueryWithFormat:sqlInsert?? @"????"];
????NSLog(@"%@"?? result);
????[self showInfo:result];
????6.??????????
????NSString *sql = @"delete from student where name = ?";
????[dataBase executeUpdate:sql??@"????"];
??????и??2??????????????????????????sql????????
?????????????????1 ????????????ù??
????2 ??????????result??ü?ù??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11