while(sqlite3_step(statement)== SQLITE_ROW)循环没有执行任何人都可以帮忙吗?while(sqlite3_step(statement)== SQLITE_ROW)永不执行?
NSLog(@" %d, %d ",sqlite3_step(statement),SQLITE_ROW);
输出总是21 100
sqlite3_stmt *statement;
sqlite3 *database;
if (sqlite3_open("myDB.sql", &database) == SQLITE_OK) {
NSLog(@"1 %d",SQLITE_OK);
NSLog(@" %d, %d ",sqlite3_step(statement),SQLITE_ROW);
const char *sql = "SELECT myName FROM myTable";
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
while (sqlite3_step(statement) == SQLITE_ROW) {
int primaryKey = sqlite3_column_int(statement, 0);
}
}
if (statement) {
sqlite3_finalize(statement);
}
}
你能告诉更多的代码? – 2011-05-10 05:32:19