RE: [PHP] searching multiple fields

2005-07-15 Thread yanghshiqi
: Friday, July 15, 2005 1:51 AM To: php-general@lists.php.net Subject: Re: [PHP] searching multiple fields Brent Baisley wrote: Sounds like you want to use full text indexing. Create one full text index spanning name, area, organisation. Then search on all three fields at once. SELECT * FROM

[PHP] searching multiple fields

2005-07-14 Thread Ross
Is there a way to use like to search various fields at one time. For example I want the search field to search by name or area or organisation. If the (minimum)three letter string matches any of these I want the record to show. $search_field is my textbox $query = SELECT * FROM sheet1 WHERE

Re: [PHP] searching multiple fields

2005-07-14 Thread Richard Davey
Hello Ross, Thursday, July 14, 2005, 9:37:10 AM, you wrote: R $query = SELECT * FROM sheet1 WHERE 'name' or 'area or 'organisation LIKE R '$search_field%'; SELECT * FROM blah WHERE name LIKE '$search%' OR area LIKE '$search%' OR blahblah LIKE '$search%' etc If you want to add extra conditions

Re: [PHP] searching multiple fields

2005-07-14 Thread Lawrence Kennon
...I want it to do the folowing. $query = SELECT * FROM sheet1 WHERE 'name' or 'area or 'organisation LIKE '$search_field%'; SELECT * FROM sheet1 WHERE 'name' LIKE '$search_field%' OR 'organization' LIKE '$search_field%' lk

Re: [PHP] searching multiple fields

2005-07-14 Thread Brent Baisley
Sounds like you want to use full text indexing. Create one full text index spanning name, area, organisation. Then search on all three fields at once. SELECT * FROM sheet1 MATCH(name,area,organisation) AGAINST ('textstring* otherstring* etc*). The * means use LIKE searching. There are a

Re: [PHP] searching multiple fields

2005-07-14 Thread Amir Mohammad Saied
Brent Baisley wrote: Sounds like you want to use full text indexing. Create one full text index spanning name, area, organisation. Then search on all three fields at once. SELECT * FROM sheet1 MATCH(name,area,organisation) AGAINST ('textstring* otherstring* etc*). The * means use LIKE