Re: Multiple word queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



By Shiloh's description, I think you want to replace AND with OR -
using AND will only return rows that contains every word, while using
OR will match any row that has any of them.

On Wed, 30 Jun 2004 23:22:04 -0400, John W. Holmes
<holmes072000@xxxxxxxxxxx> wrote:
> For that simple example, you can just explode the string on the space and
> create a WHERE clause entry for each word.
> 
> For example:
> 
> $words = explode(' ',$_GET['search_text']);
> foreach($words as $word)
> { $query .= " AND column LIKE '%$word%' "; }

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux