mattal999 Posted November 25, 2009 Share Posted November 25, 2009 Hi. I have an array in PHP and a table in MySQL. Array is as follows: $array = array('eminem', 'just', 'lose', 'it'); Now as you can see it contains a song name and artist, seperated into words. What I need to do is run a query against the database to check if these words match a song record that I have, and return that song. It only needs to match over 60% though, not all of the words. The table contains 'title' and 'artist' as strings. I need it to match 60% or above because there will sometimes be other words in the array, such as 'hypotenuse', which will not match the song. Here is what I have at the moment, but it obviously won't work: $query = mysql_query("SELECT id FROM musicrecords WHERE ***"); // *** to be replaced with the more complex query Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/182929-matching-over-60/ Share on other sites More sharing options...
Maq Posted November 25, 2009 Share Posted November 25, 2009 Hi mattal999, There's a fulltext search engine called Lucene that would be ideal in your situation and is very scalable. As for the matter at hand, sorry I'm not sure of a good solution. Quote Link to comment https://forums.phpfreaks.com/topic/182929-matching-over-60/#findComment-965522 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.