SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Help with a search query.
Hybrid View
-
Jan 21, 2005, 10:18 #1
- Join Date
- Jan 2005
- Location
- doberman
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Help with a search query.
Hey SP,
I have been working on a little search page for a client and can't seem to get this nailed down.Search form looks like this:
Title: (FullText MySQL)
Author:
County:
State:
When I do a search for something like "Sacramento City Directory" from the title field,
The query that get run looks like this:Code:SELECT * FROM DATABASENAME WHERE MATCH(title) AGAINST('"Sacramento City Directory"' IN BOOLEAN MODE) ORDER BY state,county,title ASC
What am I doing wrong?
Thank SP,
GregGot logical business solutions? Get SuM!
Greg Starr (SuM)
LogicStation.net
Florida Based Contract Web Developer
-
Jan 21, 2005, 11:11 #2
- Join Date
- Oct 2003
- Location
- St. Catharines, ON Canada
- Posts
- 1,708
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I had a quick peek at the manual. I haven't performed one of these before. Seems like you need a plus symbol in front of each word like so:
Code:SELECT * FROM DATABASENAME WHERE MATCH(title) AGAINST('+Sacramento +City +Directory' IN BOOLEAN MODE) ORDER BY state,county,title ASC
http://dev.mysql.com/doc/mysql/en/Fulltext_Boolean.html
-
Jan 21, 2005, 12:15 #3
- Join Date
- Jan 2005
- Location
- doberman
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks man that was it!!! Good loooking out.
Got logical business solutions? Get SuM!
Greg Starr (SuM)
LogicStation.net
Florida Based Contract Web Developer
Bookmarks