Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199901

Re: [PHP3] querying multiple fields of database From: Richard Lynch (lynch <email protected>)
Date: 01/22/99

At 2:05 PM 1/22/99, Mark wrote:
>Hi all,
>
>Would anyone have any direction for querying multiple fileds
>of a mysql database using only one "search" button?
>I expect these are rough waters.

I dunno the MySQL way to search within a field for case-insensitive text,
but the idea is:

$query = "select field1, field2, field3 from sometable where field1 ~*
'$key' or field2 ~* '$key' or field3 ~* '$key'";

Nothing real tricky, until you want to start ranking results by number of
hits or something...

If you want to build a search engine for your whole site, you should save
yourself a lot of headaches and use htdig or glimpse et al.

-- "TANSTAAFL" Rich lynch <email protected> webmaster@ and www. all of:
R&B/jazz/blues/rock - jademaze.com music industry org - chatmusic.com
acoustic/funk/world-beat - astrakelly.com sculptures - olivierledoux.com
my own nascent company - l-i-e.com cool coffeehouse - uncommonground.com

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>