ok guys got this code from the chat.php in wap.net.ph
its part of the quiz code . my problem is it seems to be only selecting the one question which is id 14 out 30 . which would suggest to me its the middle one all the time as the code suggests its gets the max and min question.
can anyone help me so it selects the questions at either totally random or in order.
thanks .
its part of the quiz code . my problem is it seems to be only selecting the one question which is id 14 out 30 . which would suggest to me its the middle one all the time as the code suggests its gets the max and min question.
Code:
$range_result = mysql_query( " SELECT MAX(`id`) AS max_id , MIN(`id`) AS min_id FROM `ibwf_quiz` "); $range_row = mysql_fetch_object( $range_result ); $random = mt_rand( $range_row->min_id , $range_row->max_id ); $result = mysql_query( " SELECT question, answer, id FROM `ibwf_quiz` WHERE `id` >= $random LIMIT 0,1 "); while($rpgds=mysql_fetch_array($result))
can anyone help me so it selects the questions at either totally random or in order.
thanks .
Comment