User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,314 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,837 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

it's simple but yet complicated...php and mysql search..

Join Date: Nov 2006
Posts: 1
Reputation: mkhalid is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mkhalid mkhalid is offline Offline
Newbie Poster

Re: it's simple but yet complicated...php and mysql search..

  #10  
Nov 28th, 2006
In mysql, you can use "FULL TEXT SEARCH" option. For this you have to add index on all of three fields First name, Last name and Phone.
After that you will use the query
SELECT rowid, (match (firstname, lastname, phone) against ('$keyword')) as score 
FROM contact 
where (match(firstname, lastname, phone) against ('$keywork'))

OR

SELECT rowid, (match (firstname, lastname, phone) against ('$keyword')) as score 
FROM contact 
where (match(firstname, lastname, phone) against ('$keywork') IN BOOLEAN MODE)

For detail about the full text search you can read
http://dev.mysql.com/doc/refman/4.1/...xt-search.html
Last edited by mkhalid : Nov 28th, 2006 at 2:00 am.
Reply With Quote  
All times are GMT -4. The time now is 2:37 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC