Great tutorial. I'd like to ask on HOW TO SAVE THE SCORE INTO THE DATABASE?
@SomoyeTosin7 жыл бұрын
You are really doing a great work sir, this has really helped me. Please sir, is it possible to have my question come in random? I have been able to make choices for each question be randomize but I will like the question come in random sir. Hope you reply soon sir.
@kdford20576 жыл бұрын
Is it possible to use images as choices? Thank you
@keithpogzkeithpogzosu12504 жыл бұрын
great video sir! May i ask of how to connect this to a login page?
@sonalkakkar29617 жыл бұрын
Hi, thanks a lot for these awesome tutorials..But i have a doubt in this, i followed the same as you did but when i am hitting submit button, my page is not redirecting to the next question, it remains there only,. also i did echo $number and $selected_choice and i am getting only selected choice not the numnber like this Array ( [choice] => 4 [number] => ) ypu cam see there is no number displaying. Please help me as soon as possible..thanks n advance
@ravishankarps20757 жыл бұрын
make sure that this line in question.php is correct because i also got the same error
@TobiasPalludan7 жыл бұрын
Awesome tutorial. It was great to see you debug and how you went about it. One note though: If you take this quiz multiple times, the score will be added upon the previous results because the session is still active. I fixed the result by adding session_destroy(); to the end of final.php. I don't know if this is the best approach though.
@TobiasPalludan7 жыл бұрын
To add to my own comment. I changed my approach, and in process.php I started by checking, if the number was 1 and then reset the score. To do that I did the following: After if($_POST) we get the number in $number = $_POST["number"]; (line 10 in the video) After this line I simply added: if($number == 1) { $_SESSION["score"] = 0; } Now there's no need to have the session_destroy(); in the final.php, as that will not make it possible for the user to update the final page without loosing their score. Cheers :)
@vishalsinghshekhawat63887 жыл бұрын
how fix this problem "fixed the result by adding session_destroy(); ",what i do .....please tell me sir again
@TobiasPalludan7 жыл бұрын
Vishal Vishal did you do what I mentioned in my own response? You essentially reset the score when you start the quiz
@vishalsinghshekhawat63887 жыл бұрын
sir when i take a quiz multiple times,score added upon the previous result ....i want solve this problem, what is code to write in final.php....please
@vishalsinghshekhawat63887 жыл бұрын
m waiting your answer sir
@giftmusanza92054 жыл бұрын
if the $_SESSION['score'] is still incrementing, destroy the session when you get to final.php. Add this to final.php as shown in the source code
@kennaawaaqayyoo48524 жыл бұрын
pls can you do this using recent php mysqli and pdo method?
@furqanparvez26506 жыл бұрын
I was wondering what would need to be done in order to record the answers selected by the user, i.e. like storing the results in a table for each time it has been completed. Kind of like a survey, keeping a tally of how many times an answer has been chosen?
@eduonixsupport18895 жыл бұрын
Please refer the link mentioned below for getting an idea about your query. www.sitepoint.com/community/t/how-do-you-submit-quiz-scores-to-database-table/110443
@robertokakur49962 жыл бұрын
Yo did you manage to do it and could you mabye send me the code, would apreciate it :)
@demian55116 жыл бұрын
If anyone has a problem with score after repeating the quiz, possible solution is to reset the score if clicked on a " repeat " button, and redirect to questions.php?n=1 : if(isset($_POST['repeat'])){ $_SESSION['score'] = 0; header('Location: questions.php?n=1'); } Don't know if it is the best approach but it works!
@demian55116 жыл бұрын
So you don't have to destroy session.
@Eduonix6 жыл бұрын
Thank you for your valuable input, Demian. We hope it helps other students. Subscribe for more updates!
@invsg50723 жыл бұрын
How do you include 'n' in the URL?
@維馨郎4 жыл бұрын
Can you help me fix the problems? Notice: Trying to access array offset on value of type null in D:\xampp\htdocs\aaaa\quiz\question.php on line 68 of 5 Notice: Trying to access array offset on value of type null in D:\xampp\htdocs\aaaa\quiz\question.php on line 70 Notice: Undefined index: score in D:\xampp\htdocs\aaaa\quiz\final.php on line 37 Also, I cannot switch questions while I press the button.
@moxlofi4 жыл бұрын
having the same issue. Did you manage to figure it out?
@nickobalute66567 жыл бұрын
can you create quiz with timer?
@Eduonix7 жыл бұрын
Sure, Nicks. We will try to do it in our next tutorials. Subscribe us to get updates on latest courses.
@robertokakur49962 жыл бұрын
Sir how do i save the Iteration from the right answers in a Database?
@vishalsinghshekhawat63887 жыл бұрын
sir u please read my problem- i create 3 quiz- i select right choice of 1 quiz and submit then get number = 1 now m on 2nd quiz i select right choice and submit then i get total number=2 now m on 3rd quiz but.. now if i back again on 2nd quiz, again select right choice and submit now total get number = 3 (this is my problem) now again on 2nd quiz,again select right choice and submit same then get number=4 again same then get number = 5....... now 3rd quiz select right choice and submit then get total number = 6 how solve this problem sirrr....
@pocong7ganu7 жыл бұрын
read the top comment.. After if($_POST) we get the number in $number = $_POST["number"]; (line 10 in the video) After this line I simply added: if($number == 1) { $_SESSION["score"] = 0; } Now there's no need to have the session_destroy(); in the final.php, as that will not make it possible for the user to update the final page without loosing their score.
@patrickjohnobsina45996 жыл бұрын
Hi sir! Thank you for that tutorial, I have an error that the score keeps increasing and when i refreshing it, it keeps increasing more. why is that happening?
@eduonixsupport18896 жыл бұрын
You can download the resource file from the s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-AddQuestionForm.zip.
@sirius8ly5 жыл бұрын
Hello. Did you ever get this figured out? I am still running into the same problem even though I copied his code.
@imanechakri42904 жыл бұрын
@@sirius8ly same thing here can u help me
@sirius8ly4 жыл бұрын
@@imanechakri4290 Hello imane. Sorry. He is so busy I don't think he has time to check these messages. I never could get it to work so I moved on to other projects. Sorry I couldn't be more helpful.
@secundatime74472 жыл бұрын
@@sirius8ly Hey if you're still wondering how to do it I managed to fix it by adding onClick="" so like:
@維馨郎4 жыл бұрын
Can you help me fix the problem? When I press the submit button, the url doesn't change, thus the question didn't go to the next one. thank you
@baburamchaudhary1596 жыл бұрын
I follow you completely but I get offset that I am not being able to fix the error: Notice: Undefined index: number in C:\xampp\htdocs\quizzer\process.php on line 17 Array ( [choice] => 3 ) you have also got error at: 7:43 minutes how to fix it ... Please help me sir
@angelcruz-ny4yy6 жыл бұрын
Whare can i find the github repo for this video ? i'm having a error with process.php
@eduonixsupport18896 жыл бұрын
You can download the resource file from the dashboard. s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-ProcessAnswers.zip and s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-AddQuestionForm.zip
@pianoLee-sx9dx6 жыл бұрын
I am just wondering why the isset function does not work here whereas it does work in my login page and I have the same thing that you have...
@eduonixsupport18896 жыл бұрын
You can download the resource file from the s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-AddQuestionForm.zip
@pianoLee-sx9dx6 жыл бұрын
I finally got it working and it was my fault though... thanks for the tutorial! Just wondering, for some reason, I can't get it to work if I am using $resultcheck= mysqli_num_rows($result); I don't know why... it says something about boolean given error...
@ravishankarps20757 жыл бұрын
I have 2 questions in my db and when i click the submit button the url gets incremented "questions.php?n=2" but it says object not found help me please
@tahiraziz17 жыл бұрын
same error kya kru
@eduonixsupport18897 жыл бұрын
header("Location:question.php?n=".$next);Check this line of process.php . Check your question.php file name is same as written in above line code .
@RezaJafari19846 жыл бұрын
After refreshing the final page this message showing :Notice: Undefined index: score in C:\xampp\htdocs\quizzer\final.php on line 25
@eduonixsupport18896 жыл бұрын
You can refer link. to download the resource file from the dashboard.s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-ProcessAnswers.zip
@dinaprakash51455 жыл бұрын
The score is getting incremented(with old score) continuously everytime I rerun the quiz. How to resolve it!?
@rikiyang30034 жыл бұрын
add this code at the end of final.php
@keithpogzkeithpogzosu12504 жыл бұрын
@@rikiyang3003 thanks alot
@MovieHeretic7 жыл бұрын
Well that was weird, changed $_SESSION['score']++ to $_SESSION['score']+1; and the session variable didn't get increased by 1????
You can refer link. to download the resource file from the dashboard.s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-ProcessAnswers.zip
@ganeshpathak80037 жыл бұрын
how to check the answer... ??
@eduonixsupport18897 жыл бұрын
Please describe your question?
@fullclubmix7 жыл бұрын
Line 19 error? $results = $mysqli->query($query) or die ($mysqli->error.__LINE__); Undefined variable: mysqli in C:\........ on line 19 Fatal error: Call to a member function query() on null in C:\.........on line 19 help.
@eduonixsupport18897 жыл бұрын
Use $result instead of $results
@fullclubmix7 жыл бұрын
same error I followed the tutorial until the end if it works only that error is the only one.
@unfoldingcode6 жыл бұрын
you are supposed to use another sql version....
@rajankumar-fr2df6 жыл бұрын
use $mysqli instead of $conn in database connection(database .php file)
@VikramSingh-xw7tl6 жыл бұрын
Send me source code
@Eduonix6 жыл бұрын
Hello Vikram !! find the source code: github.com/eduonix/PHPQuizzerusingPHPandMySQL.git