Network_ninja Posted September 8, 2011 Share Posted September 8, 2011 Hi everyone.. pls. help. I don't have yet a working code since i don't have an idea on how to do it. I just want to have a simple search query. Lets say that if I am going to search for the word 'smith' all firstname that is similar to that will be displayed: eg. Smithe Smit Smiht This is not possible using LIKE since the output would only be Smithe. Tnx in advance. Quote Link to comment Share on other sites More sharing options...
gristoi Posted September 8, 2011 Share Posted September 8, 2011 u might want to take a look at fulltext searching. heres a decent article: http://devzone.zend.com/article/1304 Quote Link to comment Share on other sites More sharing options...
Network_ninja Posted September 9, 2011 Author Share Posted September 9, 2011 tnx for that info... But thats not what I'm looking for: Say I have this value on my table firstname Smithe Smith Smoothe Smooth Smithe if i am going to use this query SELECT * FROM tablename WHERE MATCH (firstname) AGAINST ('Smith') It would only output : Smith The desirable output would be Smithe Smithe Smith I am looking for the MYSQL REGULAR EXPRESSION to do the thing but don't have yet come up with a correct one.... Quote Link to comment Share on other sites More sharing options...
fenway Posted September 9, 2011 Share Posted September 9, 2011 Did you try that query? Because there is no regex that will do this quickly. Quote Link to comment Share on other sites More sharing options...
Network_ninja Posted September 10, 2011 Author Share Posted September 10, 2011 Yes i did try that query... If there are also records that is somewhat similar to the word will be outputed: e.g Smiht Smiith Is my concern impossible to achieved? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 10, 2011 Share Posted September 10, 2011 Fulltext searches do stemming, but they won't correct misspellings. Quote Link to comment Share on other sites More sharing options...
Network_ninja Posted September 10, 2011 Author Share Posted September 10, 2011 tnx for the reply. its just that we have a database of our clients nd sometimes the encoder mistype the names. so if your going to search for the names it won`t come. So im thinking if its posibble to display the related words. tnx for all ur help guys. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 10, 2011 Share Posted September 10, 2011 You might want to read this. Quote Link to comment Share on other sites More sharing options...
Network_ninja Posted September 10, 2011 Author Share Posted September 10, 2011 tnx. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.