Handling a php generated match value for sorting in mysql


We currently have a matches system between two types of our users.

We run our match generator via PHP that outputs a percentage value.

The problem we are having is getting the value and using it within a query lower down the page in order to use the percentage value in a ORDER BY statement.

We first thought we could use a temp table and then inner join it to the data being selected from the database and although we have matching primary keys the temp table will not inner join.

Is there anyone with any suggestions.

Otherwise it will mean that we will have to set up a table to manage this separately. One row per user, per match with another user.
(A not preferred solution due to the number of rows that  will be inserted)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

could you provide more detail about your base table(s), some sample data and expected result?

it 'sounds like' something you should be able to do in SQL - but without more information we can't really provide an answer in my view.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
YashyAuthor Commented:
hi mate,

this was questioned by our developer and I can't reach him, so I will close this for now and if need be will get him to post more clearly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.