
April 17th, 2007, 02:19 AM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: 7 m 14 sec
Reputation Power: 0
|
|
String matching help
i am fairly new to this and was wondering if you guys can help me . I am basically making a search function for a site here is what i have so far
PHP Code:
$database->setQuery( "SELECT * FROM #__mt_cats AS c"
. "\n WHERE c.cat_name OR c.metakey LIKE '%$searchword%' "
. "\n AND cat_published='1' AND cat_approved='1' "
. ( (!empty($only_subcats_sql)) ? $only_subcats_sql : '' )
);
now this matches the words fine if i search for a single word say if i want to search for "pipe" i get to the category plumber (cause of meta key word). I want the results to match if for example this string is entered :
"i want to fix a pipe in my house"
any help ?
thanks !
|