I have a big database of contest entrants and I have randomly selected 30 names from this database to be winners. Part of the rules of this contest were that you could enter as many times as you want, so when I picked a winner, I have updated all their entries as having won and given them a number based on what day they won. (ex. for the first winner - won=\'1\' for the second won=\'2\', etc.)
Now for the tricky part...
I want to create a page that pulls one record from each winner and displays their information. So how do I pull only one record from all the winners?
I thought about doing something like this:
$sql1 = \"SELECT * from tbl_name WHERE won=\'1\' LIMIT 1\";
$sql2 = \"SELECT * from tbl_name WHERE won=\'2\' LIMIT 1\";
$sql3 = \"SELECT * from tbl_name WHERE won=\'3\' LIMIT 1\";
Etc.
but it seems very ineffiecient.. especially since this contest is going to run for 30 days.
So is there a mySQL statement that I can use to make this an easier task? Or do I just have to hash each winner out one at a time?
Thanks in advance.