galvin Posted January 30, 2010 Share Posted January 30, 2010 I put this in wrong forum, how do I move it? I'm not asking anyone to write any code at all, just hoping someone could let me know if I'm headed in the right direction, in terms of a general outline IN PLAIN ENGLISH. I have a pretty good grasp of PHP but I have never done anything this complicated before so I want to make sure I have the most efficient plan of attack before I delve in. And the process seems complicated to me, but I assume some of you experts will laugh at me for thinking it's complicated Anyway, here is the gist. I have two tables that matter here... GUESSES and RESULTS Inside Guesses, there are about 10 category fields. These fields get populated with guesses from website visitors. All that is working fine (i.e. the guesses are getting entered into the guesses table fine). RESULTS gets populated with one single set of the CORRECT, ACTUAL answers to each guess category. So now what I have to do, is compare ALL the guesses in the GUESSES table to the correct answers in the RESULTS table. This would be easy if there was only one set of GUESSES, but there could be up to 50 different sets of guesses in the GUESSES table. Also, scores will be calculated based on the accuracy of guesses and an ultimate winner will have the highest score. My thinking is... A. Store the single set of correct answers from RESULTS in an array B. Loop through each set of GUESSES and run my code to compare C. While doing B., calculate their score and store their score in an array. D. When all looping is done, take the array that should now contain ALL scores and find the biggest number E. Run code to announce the winner and do whatever else I need. Maybe you don't have enough info to answer this, but does this sound like the right way to do something like this? Quote Link to comment https://forums.phpfreaks.com/topic/190366-general-outline-for-comparing-many-values-against-one-single-set-of-values/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.