mercredi 30 août 2023

To display random questions from selected exam

$query = mysqli_query($database, "select \* from questions where e_category='$\_SESSION\[categories\]' && question_no='$que_no' order by rand() ");

Here, the problem is that I want to display a random question from the selected exam.

Exams:-

(1) PHP (2) C language (3) Java

e.g. If the user selects PHP (exam), but cannot display random questions due to the above query, they will also verify e_category='$\_SESSION\[categories\]'

No Warring appears.

$query = mysqli_query($database, "select \* from questions where question_no='$que_no' order by rand() ");

The problem arises when e_category='$\_SESSION\[categories\]' is not used, as it displays all exam questions, not just a specific exam.




Aucun commentaire:

Enregistrer un commentaire