1 2 3 4 5 6 7 8 9 |
$result = mysql_query("SELECT * FROM quiz WHERE id != $qnum ORDER BY RAND() limit 5"); while($row = mysql_fetch_array($result)) { $answer2 = $row['answer2']; } var_dump($answer2); |
Creates this
1 2 3 |
{ [0]=> string(6) " Bern^" [1]=> string(8) " Prague^" [2]=> string(8) " Berlin^" [3]=> string(10) " Sarajevo^" [4]=> string(12) " San Marino^" } |
The results will be different each time it is run.