iosDev
iosDev

Reputation: 604

select query not executing

When i am trying to execute select query not executing .

after the below line of code execution of program stopped.

NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din =? ",din];

Upvotes: 1

Views: 100

Answers (2)

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

Din must me an nsstring, what is the object type of din

if it is int, please wrap it in an NSString

Upvotes: 0

Saad
Saad

Reputation: 8947

if din is integer then,

NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din =%d ",din];

and if din is string then,

NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din ='%@' ",din];

Upvotes: 5

Related Questions