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. 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. Link to comment https://forums.phpfreaks.com/topic/182929-matching-over-60/#findComment-965522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.