sqlite issues on iphone
Posted
by
prajakta
on Stack Overflow
See other posts from Stack Overflow
or by prajakta
Published on 2010-12-24T05:00:40Z
Indexed on
2010/12/24
7:54 UTC
Read the original article
Hit count: 327
i can execute query but i can see the only last value of list_ID
i want to access 4 but i am getting 6 ???
list_ID is ----------------------->is 4
2010-12-24 12:57:07.507 DatabaseTest[3398:207] QUERY EXECUTION
2010-12-24 12:57:07.508 DatabaseTest[3398:207] bxbxbxmnb
2010-12-24 12:57:07.508 DatabaseTest[3398:207] list_ID is ----------------------->is 5
2010-12-24 12:57:07.509 DatabaseTest[3398:207] QUERY EXECUTION
2010-12-24 12:57:07.510 DatabaseTest[3398:207] bxbxbxmnb
2010-12-24 12:57:07.511 DatabaseTest[3398:207] list_ID is ----------------------->is 6
this is the code
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK)
{
while(sqlite3_step(compiledStatement) == SQLITE_ROW)
{
acat=[[[Cat_tableList alloc]init]autorelease];
///////////// statement////////
NSLog(@" QUERY EXECUTION");
// sStudent.cat_id=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
acat.list_id=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
acat.cat_id=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
acat.names=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
acat.content=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
[appDelegate.catLists addObject:acat];
(@"final AUTo_ID array is ............%@",acat.content);
NSLog(@" list_ID is ----------------------->is %@",acat.list_id); i just want value to b 4 so that i can use this somewhere
///////////////
}
© Stack Overflow or respective owner