Is it possible to select x random rows from a table, where one of the rows have to be a special row (thereby with a special field value) within one query?
Basically what I'm trying to create is a Guessing Game, where you have x amount of questions, with x amount of possible (checkbox selectable) answers!
This is how I select the answers currently... With 2 query's
$answers = 4; // This is the max amount of answers
// Just for testing the question_id is manually set
$query = "SELECT * FROM `answers` WHERE `question_id` = 0 AND `correct` != 1 ORDER BY RAND() LIMIT " . ($answers - 1) . "";
$query = "SELECT * FROM `answers` WHERE `question_id` = 0 AND `correct` = 1 LIMIT 1";
The "question_id" tells which question we are talking about, and the "correct" just tells if that field is the correct answer
So is it possible to select x random rows from a table, where one of the rows have to be "the correct one", within one query?