2010-03-25 56 views

回答

3

嘗試這個:

const char *sql = "select name from myTable where section_id=? order by name ASC"; 
sqlite3_prepare_v2(db_handle, sql, -1, &stmt, NULL) == SQLITE_OK; 
NSNumber sid = [NSNumber numberWithInt:1]; 
sqlite3_bind_int (stmt, 1, [sid intValue]); 
sqlite3_step(stmt); 
sqlite3_reset(stmt); 

記住:你應該處理錯誤返回碼。爲了簡單起見,我在這裏忽略它們。

相關問題