Thursday, July 8, 2010

pasing string value

statement "SELECT * FROM wateat_tbl where name like '%love%' or desc like '%love%'"
mixing SQL qurey + user input in one string

NSString* SQL_statement = [NSString stringWithFormat:@"SELECT * FROM wateat_tbl where name like '%%%@%%' or desc like '%%%@%%'", myStringPrt2, myStringPrt2];

const char *sqlStatement = [SQL_statement UTF8String]; // string to char need UTF8

No comments:

FEEDJIT Live