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

4 comments:

鄭湘定 said...

當一個人內心能容納兩樣相互衝突的東西,這個人便開始變得有價值了。............................................................

ju吳phe宇te佳ns said...

多謝美味的心靈雞湯......................................................................

原秋原秋 said...

希望我的支持可以帶給你快樂--加油.............................................................

原秋原秋 said...

生命的意義,是在於活的充實;而不是在於活得長久。............................................................

FEEDJIT Live