Okay, so I have flashcards. Right now I have them randomly being selected. However, randomly means sometimes seeing the same card 3 times in a row and seeing others almost never. SO... to alleviate this I need to add an incremental count. Here is my code currently:
if ($_POST['selection'] == 'EKG')
{
$options = $_POST['selection'];
$query = "Select id, question from master WHERE category1 = '$options' OR category2 = '$options' OR category3 = '$options' ORDER BY RAND() LIMIT 0,1";
$ekg = $_POST['selection'];
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
$question = $row["question"];
$id = $row["id"];
echo '</head>';
echo '<body>';
echo '<div id="wrap">';
echo '<p>Q: ' . $question;
To start this fix I've created two columns. One is called 'start' and the other is 'number'.
Basically what I envision the query above doing is looking at the start column for the number to reference. Then, it will pull up every card that has a lower number and display that. Once a user moves on, it will Increment the number in the 'number' column. Eventually, every number in the 'number' column will equal the card with the 'start' column, at which point the number of the 'start' card will increment and the process will do it all over again.
So For Instance:
Flashcard 1 is my reference/index/'start' card. It has a number of 2.
Flashcard 2 has a number of 1.
Flashcard 3 has a number of 1.
Flashcard 4 has a number of 1.
Flashcards 2, 3, 4 will be drawn randomly and shown. Once they are shown, their number will increment. Eventually their numbers will all be 2, at which time Flashcard 1 will increment to 3 - and the process begins again.
The problem is... I'm not sure how to code that. I'm familiar with the $a++ variable, I'm just not sure how to incorporate that into the code above. Any help would be appreciated.