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