Ahoy! I'm trying to code a tournament registration system. Long story short, a component of registration is a lottery; I've got more entrants than I do competition berths, so I need to pick 40 records at random from a MySQL database, with no duplication. I'm aware that there are other, non-PHP-based systems to do this, but I'd like to turn this into a learning experience if at all possible. :) Speaking of possible... is it possible? What I'm currently toying with: - Add a "selected" field to the database, default "no". - Have it pick a random number between 1 and however many, and call up the database record attached to that number. - If that record is already toggled as selected, toss it back and roll again. If it isn't, toggle it to "yes", and roll again until you hit 40. Would this work? I'd be running the script on IBserver, so bandwith and server drain isn't a concern.