homepage Welcome to WebmasterWorld Guest from 54.211.230.186
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
MySQL fulltext +relevance query won't work
snowweb

5+ Year Member



 
Msg#: 3699729 posted 11:12 am on Jul 16, 2008 (gmt 0)

I've been working on this all day and finally given up and decided to submitted it to the experts! I've already checked the manual but still can't make it work.

I'm trying to construct a query that will query multiple fields from a database table and will return just those results where the query string is found, in order of relevance.

I'm working in both PHP5 and MySQL5

This is what I have so far:


$query = "SELECT `list_id`, `business_name`, `name_first`, `name_middle`, `name_last`, `category`, `address_city`, `address_country`, `status`, MATCH ( `business_name` ,
`name_first` ,
`name_middle` ,
`name_last` ,
`address_1` ,
`address_2` ,
`address_3` ,
`address_city` ,
`address_state` ,
`address_zip` ,
`address_country` ,
`email` ,
`about_me` ,
`p_keywords` ) AGAINST ($string) AS relevancy FROM `directory` WHERE MATCH (`business_name` ,
`name_first` ,
`name_middle` ,
`name_last` ,
`address_1` ,
`address_2` ,
`address_3` ,
`address_city` ,
`address_state` ,
`address_zip` ,
`address_country` ,
`email` ,
`about_me` ,
`p_keywords`) AGAINST ($string ) AND status = 'active' ORDER BY relevancy ";

The above example returns no results, even though I know that the 4 letter term searched for, exists many times in the database fields searched.

Any help would be greatly appreciated.

Thanks guys

pete

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved