We have a competition running that I would like to automate getting the results with PHP from my MYSQL DB.
I can run a query on the Database to get the following results
Consultant1 20 sales
Consultant2 10 sales
Consultant3 5 sales
Consultant4 1 sales
Consultant5 3 sales
Consultant6 8 sales
Consultant7 30 sales
Consultant8 17 sales
Now this is where it gets tricky for me........
For every 10 sales the consultant gets thier name entered in a draw, so if the have 30 they have 3 entries.
perhaps I need to add all the entries to a virtual table or array of sorts then randomly pick one as the winner.
Anyone have any ideas on how I should be going about this??
I value your assistance