Retrieving values from SQLite table iOS

78 views Asked by At

As I'm new to iOS programming,I have a doubt in retrieving data corresponding to a particular integer id from SQLite database table?

This is what I tried but seems wrong:

NSInteger id=  sender.tag;
FMResultSet *rs = [self.databaseFM executeQuery:@"select * from tblVenue where venue_id = ?",id];

Is the problem related to Integer typecasting?

1

There are 1 answers

0
Vizllx On BEST ANSWER

Just use -numberWithInteger: like this :-

NSInteger id=  sender.tag;
FMResultSet *rs = [self.databaseFM executeQuery:@"select * from tblVenue where venue_id = ?", [NSNumber numberWithInteger:id]];