One quiz item per page (php/mysql quiz program)

前端 未结 2 1428
-上瘾入骨i
-上瘾入骨i 2021-01-16 23:33

I\'m currently working on a quiz program using PHP/mySQL (my first time ever actually using either).

Up until now I was just working on getting it all functioning co

相关标签:
2条回答
  • 2021-01-17 00:12

    All you need to get the all questions from Database, and using jquery show()/hide() method show only one questions at a time.

    I had written sample script for your requirement here.

    http://www.smarttutorials.net/responsive-quiz-application-using-php-mysql-jquery-ajax-and-twitter-bootstrap/

    0 讨论(0)
  • 2021-01-17 00:14

    Firstly you are re creating the $q_array on each page so it will only contain the last displayed question which will not work

    try

    if(isset($_SESSION['questions']))
    {
       $_SESSION['questions']+= ", $question_id";       
    }
    

    In the select query you should omit the questions with the already displayed in the array.

    0 讨论(0)
提交回复
热议问题