FMDB query isn't acting right with LIKE FMDB query isn't acting right with LIKE sqlite sqlite

FMDB query isn't acting right with LIKE


The wildcard characters (%) have to be part of the substituted variable, not the query string:

FMResultSet *rs = [db executeQuery:@"SELECT * FROM athletes WHERE athlete_name LIKE ?",                  [NSString stringWithFormat:@"%%%@%%", search_text]];