Thread: Search
Hi I hope someone can help me.... My problem: I have make a search machine whit: LIKE '%$suchbegriffe[$i]%' but when I search Test - the search machine shows only entries whit Test. But not test or tESt. (sorry for my bad english) Regards, Sebastian
On Mon, 5 Feb 2001, Sebastian --[ www.flashhilfe.de ]-- wrote: > I have make a search machine whit: > > LIKE '%$suchbegriffe[$i]%' > > but when I search Test - the search machine shows only entries > whit Test. But not test or tESt. LIKE is case-sensitive. You should convert your column to uppercase: WHERE UPPER(field) LIKE ... or use case-insensitive regular expression: WHERE field ~* '<regexp>' -- Brett http://www.chapelperilous.net/~bmccoy/ --------------------------------------------------------------------------- The Angels want to wear my red shoes. -- E. Costello
force lower case or use the non case-senstitive search e.g. lower(column) LIKE lower('%$suchbegriffe[$i]%') or column ~* '$suchbegriffe[$i]' (no need for wildcards when using ~* it assumes %value%) "Sebastian --[ www.flashhilfe.de ]--" <hallogammler@aol.com> wrote in message news:95n58g$5fa$1@news.tht.net... > Hi > > I hope someone can help me.... > > My problem: > > I have make a search machine whit: > > LIKE '%$suchbegriffe[$i]%' > > but when I search Test - the search machine shows only entries > whit Test. But not test or tESt. > > (sorry for my bad english) > > Regards, Sebastian > >
Thank you!!! It works perfect !! Regards, Sebastian PM <pmeloy@home.negate.spam.com> schrieb in im Newsbeitrag: 95otrr$hjg$1@news.tht.net... > force lower case or use the non case-senstitive search e.g. > > lower(column) LIKE lower('%$suchbegriffe[$i]%') > > or > > column ~* '$suchbegriffe[$i]' > (no need for wildcards when using ~* it assumes %value%)
Hi, You seem want to match string insensitively, I guess. Try: ~* 'test' -- match Test|tEst|tESt ... ~* '.*test.*' -- match whateverTesTwhatever Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com On Mon, 5 Feb 2001, Sebastian --[ www.flashhilfe.de ]-- wrote: > Hi > > I hope someone can help me.... > > My problem: > > I have make a search machine whit: > > LIKE '%$suchbegriffe[$i]%' > > but when I search Test - the search machine shows only entries > whit Test. But not test or tESt. > > (sorry for my bad english) > > Regards, Sebastian > >