I'm writing a script to display one quiz item to a user at a time, the items will be displayed in a random order and the same item will not be displayed twice, I was wondering the best way to select a random question given that I have an array of questions that have already been selected, should I loop through the array building a huge WHERE clause? Would it be possible to have a table named `viewed` that has has a user id column, then do something like (dont even know if this is valid mySQL or not):
Thank you for the thorough explanation, you answered all my questions.
EDIT: sorry for posting in the wrong forum, I figured it should have gone in theory since the original question I asked was "how do I do this, should I use PHP to build a CSL from an array, or use a subquery" (which is not a question about databases, but rather a question of design), since it was not "how do i write a subquery" I thought it belonged in there.
By the way, I used an inner join because my mysql didn't support sub queries.