Forum Moderators: open
I'm trying to figure out the best (any) way to do a relevancy query based on how closely a group of four numbers in a row match a supplied set of numbers.
Basically, in each player's row, I have four game rankings that make up 100 points total. They may, for example, be given 40 for score A, 25 for score B, 20 for C, and 15 for D
And, I want to be able to return a result set that's weighted based on the someone who's got a certain set of scores
In one scenario, I want the results by who's closest to a C of 45 and B of 20
In another scenario, a A of 50, a D of 20, and a B of 5
etc
I want to weight the results based on who is closest to the first selection, then the second, then the third, etc...
Is this even doable? Or do I have to just get ALL of the records and sort with PHP some how? :0
I can restructure the database in any way that would help.
PHP5/MySQL5
TIA!