[turba] Case sensitive vs. case insensitive search

Lars Nummedal lars@nummedal.net
Tue, 18 Sep 2001 10:42:47 +0200


Hi again,

Thanks for your interest.

Quoting Chuck Hagenbuch <chuck@horde.org>:

> Quoting Liam Hoekenga <liamr@umich.edu>:
> 
> > oracle does the same thing..
> 
> case-sensitive by default? Can you tweak the table structure, or do
> you need a 
> different query? ... etc.

After poking around a little, I found out that the 'ilike' function does the
trick; i.e. I changed the


            if (in_array($key, $strict_fields)) {
                $where .= "$key = '$val'";
            } else {
                $where .= "$key like '%$val%'";
            }

to be

            if (in_array($key, $strict_fields)) {
                $where .= "$key = '$val'";
            } else {
                $where .= "$key ilike '%$val%'";
            }

Now my searches are case insensitive both in Turba and of course when using
turba under IMP. I have considered signing up as a developer for the Horde team
(that is, if you want me to contribute), but that won't happen until December. I
am busy finishing my Ph.D. thesis at the moment.

Regards,
Lars Nummedal
-- 
A penguin a day keeps the blue screens away.