DepressedAsian Posted April 15, 2015 Share Posted April 15, 2015 Hey so the issue that I have is, I am trying to remove a SQL value from a user entered value. For example, is a user types in red Ford Mustang, it should remove 'red' from the search because Ford Mustang is equal to something the user typed and something which is in the database. I have tried the preg match, chop, str_remove, trim functions and they don't seem to work. please help Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 15, 2015 Share Posted April 15, 2015 I'm going to try to interpret what you want. What you're looking for is a full text index capability. Full text allows you to find phrases or portions of phrases inside text. Standard text indexes really don't support this without at very least, doing tablescans. MySQL does have fulltext indexes, with some caveats in terms of their availabiitity given a mysql engine or version. There are a number of fulltext engines like sphinx, elastic search and Lucene. PHP has support for all these engines through third party libraries. Most sophisticated sites have tended to use full text engines, due to the many available features, but you should probably read up on the mysql full text system to see if that will work for you as it will be faster and easier for you to setup if you already are using mysql. 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.