the schema of the tables would be something like this:
Code:
Notes:
noteID
noteName
Chords:
chordID
chordName
Relation:
chordID
noteID
the logic from here is where it could go many different ways. here is how i'd approach it at first thought...
1. get the array of notes from the user.
2. for each chord, compare how many of the input array notes match.
3. after you match the input with a chord, it is still possible that the chord has more notes than what the user input. here i would count the total number of notes entered for the chord found.
4. compare the number of notes in the chord, to the number of notes in the user array.
5. if they match, then return the chord.
you could probably get pretty tricky if you didn't find an exact match around step number 4, and then list a suggestion of what the closest chord it found was if there is not an exact match.