Jump to content

Matching over 60%


mattal999

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.