select LIKE

Поиск
Список
Период
Сортировка
От Kevin Heflin
Тема select LIKE
Дата
Msg-id Pine.LNX.4.02.9809031713540.24099-100000@mercury.shreve.net
обсуждение исходный текст
Список pgsql-general
I have a rolodex database in Postgres.
I want allow searches by "name" and/or company from a web page.
I'm using PHP/Apache to connect with postgres

I tried something like:

select * from rolodex where name LIKE '%$name%'

First question: is there a way to do this that is NOT case sensitive?

also I wanted to allow for searches of name and/or company..

but if a user enters info in "name" and not "company" it returns back no
items found.

I'm using '%$company%' (percent signs on both sides so that the user can
take a short guess. However if the user doesn't input anything for
company, this returns no items.. if I have the variable set up as:

'%$company' with only the percent sign in the beginning, it will work o.k.

Any suggestions would be appreciated.

Kevin




--------------------------------------------------------------------
Kevin Heflin          | ShreveNet, Inc.      | Ph:318.222.2638 x103
VP/Mac Tech           | 333 Texas St #619    | FAX:318.221.6612
kheflin@shreve.net    | Shreveport, LA 71101 | http://www.shreve.net
--------------------------------------------------------------------


В списке pgsql-general по дате отправления:

Предыдущее
От: "Richard Ryan"
Дата:
Сообщение: Questions about year 2000 compliance and support
Следующее
От: David Hartwig
Дата:
Сообщение: Re: [GENERAL] select LIKE