Re: Case-sensitive searches in php/postgresql
| From: | Jason Wong | Date: | Tue, 29 Apr 2003 14:26:16 +0000 |
| Subject: | Re: Case-sensitive searches in php/postgresql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145660@lists.php.net to get a copy of this message | ||
On Tuesday 29 April 2003 20:32, Matt MacLeod wrote:
> I have built a database of recipes and a fairly simple search facility.
>
> The user can search either by ingredient or by recipe name. Ingredients
> are stored in a 'text' field in postgres and the recipe names are stored
> in a varchar(100) field.
>
> The problem is that I want to be able to perform 'case-less' searches.
> For example, the first record in the db is 'Pheasants with Bacon'
> (capital P on Pheasants). However if the user searches for 'pheasants',
> they are returned 0 results.
>
> Is there any way to make postgresql disregard the case of the text in
> the field so that a user can search for Pheasant or pheasant, (or
> PhEaSaNT for that matter) and still get the results?
This has nothing to do with PHP. Questions such as these are best directed at
the postgresql lists.
A quick look at the postgresql manual would have told you that you could use
ILIKE.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Let the worthy citizens of Chicago get their liquor the best way
they can. I'm sick of the job. It's a thankless one and full of grief.
-- Al Capone
*/