•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 397,639 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,339 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 999 | Replies: 8
![]() |
•
•
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation:
Rep Power: 1
Solved Threads: 2
•
•
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation:
Rep Power: 1
Solved Threads: 2
•
•
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation:
Rep Power: 1
Solved Threads: 2
mysql Syntax (Toggle Plain Text)
SELECT * FROM mytable WHERE MATCH(title,content) AGAINST('+search* ~term' IN BOOLEAN MODE) ORDER BY relevance DESC;
MySQL uses your query as a kind of voting system. How you arrange your query and which operators you use, determines which row gets the most number of votes. The row with the most votes gets returned first.
•
•
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation:
Rep Power: 1
Solved Threads: 2
•
•
Join Date: Feb 2007
Location: St. Vincent and the Grenadines, Caribbean
Posts: 958
Reputation:
Rep Power: 3
Solved Threads: 39
I found another way to do this.
The table name is Employees . The field name is Role. The query finds all rows in Role that contain an A and the word Sales and returns them in order of relevancy.
Hopefully you can manipulate this code and get it to work for you.
The table name is Employees . The field name is Role. The query finds all rows in Role that contain an A and the word Sales and returns them in order of relevancy.
mysql Syntax (Toggle Plain Text)
SELECT *, MATCH(Role) AGAINST('+A* *Sales' IN BOOLEAN MODE)AS relevance FROM Employees ORDER BY relevance DESC;
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
adsense adult advertising blog blogging bomb book business coding competition copyright daniweb development earth engine environment failure forum gentoo google internet legal linux malware marketing mcafee microsoft monetization msn news operating pagerank phishing php privacy publishing revenue search security silverlight software spam spyware support system technical web webmaster wiki yahoo
- Backlinks? (Search Engine Optimization)
Other Threads in the PHP Forum
- Previous Thread: associative arrays in JS and POST to PHP
- Next Thread: Comics website using php/mysql


Linear Mode