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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.