Wiki

Articles tagged with "wildcard"X
Displaying 1-1 of 1 result(s).

Alternative wildcard characters CDbCriteria

Created 2 years ago by maigretHow-tos0 comments – viewed 5,397 times – ( +3 ) – version 1.1
In SQL, wildcard characters can be used in "LIKE" expressions; the percent sign (%) matches zero or more characters, and underscore (_) a single character. Sometimes users are not familiar with these or they are using different ones like (*) and (+) similar to regular expressions. My colleages do so and then i decided to add this feature by extending CbCriteria. Especially adding a new parameter $wildcard_chars to the method addSearchCondition to replace them if needed with standard SQL characters: