I want to make an sql statement -
sqlStatement = [NSString stringWithFormat:@"SELECT * FROM movies where title like '%%@%'",searchKeyword];
But sqlStatement is becoming -
"SELECT * FROM movies where title like '%@'"
I want to make it
"SELECT * FROM movies where title like '%searchKeyword%'"
How can I escape the "%" character?
Thanks
Try :
sqlStatement = [NSString stringWithFormat:@"SELECT * FROM movies where title like '%%%@%%'",searchKeyword];
"%%" is the way of printing the '%' character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With