RE: [PHP-DB] anyone trickier than 'LIKE' ?

2003-12-12 Thread N . A . Morgan
$keywords = str_replace(' ','%',$keywords);
select * from table where data like "%keywords%";

-Original Message-
From: Hadi [mailto:[EMAIL PROTECTED] 
Sent: 12 December 2003 13:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] anyone trickier than 'LIKE' ?


Hi all,
I have this data (eg.) "..big fat buddy..." on the database . If
a person enter "big buddy" in the search form , the "...big fat
buddy." data will not be found . Any suggestion ? Thanks in advance.


select * from table where data like "%keywords%";

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

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



Re: [PHP-DB] anyone trickier than 'LIKE' ?

2003-12-12 Thread Larry E . Ullman
I have this data (eg.) "..big fat buddy..." on the 
database . If
a person enter "big buddy" in the search form , the "...big fat
buddy." data will not be found . Any suggestion ?
select * from table where data like "%keywords%";
You can break up the search terms into words and do
...data LIKE '%$keyword[0]%' OR data LIKE '%$keyword[1]%'...
This will be slow though. You could also do full text searches if you 
are using MySQL. Have good indexes for whichever route you go.

Larry

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