Here is my code i am getting only the last value of the database in the array but i need the entire column values in my array...
//select the values from the db
NSString *sql = [NSString stringWithFormat:@"SELECT * FROM district_details"];
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(db, [sql UTF8String], -1, &statement, nil)==SQLITE_OK)
{
while (sqlite3_step(statement)==SQLITE_ROW)
{
char *field2 = (char *)sqlite3_column_text(statement, 1);
field2Str = [[NSString alloc]initWithUTF8String:field2];
str = [NSString stringWithFormat:@"%@", field2Str]; NSLog(@"the value from thr field1 from the district name is %@...",field2Str);
myarray =[[NSMutableArray alloc]initWithObjects:@"--select the value--",nil];
[myarray addObject:field2Str];
NSLog(@"the value of the myarray is......%@",myarray);
}
}