Page 1 of 1

Error after taking quiz

Posted: Sat Sep 23, 2006 4:05 am
by BathroomNinja
Everything apeared to install fine. I double checked that I copied everything over correctly. There was a red line when I installed the quiz (first time user), on the second line. I am able to create quizes and then play them. However, when I click 'submit quiz' (/quiz.php?mode=results in the url), I get the following:

Code: Select all

Could not obtain the user id

An Error Occurred

DEBUG MODE

SQL Error : 1146 Table 'apdcadetsboards.apdphpbb_quiz_statistics' doesn't exist

SELECT stats_id FROM apdphpbb_quiz_statistics ORDER BY stats_id DESC LIMIT 1

Line : 31
File : functions_quiz.php
So, I went to take a look at line 31 in functions_quiz.php, but I can't figure it out. I am running on dreamhost, with PHP 5.1.2
I love the quiz software, great work! I'm sure I'm doing something wrong here, any help would be nice. Thank you in advance.

Posted: Sat Sep 23, 2006 3:16 pm
by BathroomNinja
Hoorah! I fixed it!. Here is how I fixed my issue..

As I mentioned, I had a red line while installing. I should not have ignored that line. The line that was red was this one:

Code: Select all

CREATE TABLE apdphpbb_quiz_statistics ( `stats_id` int(5) NOT NULL default '', `quiz_id` int(10) NOT NULL default '', `user_id` int(10) NOT NULL default '', `stats_correct` INT(5) NOT NULL default '0', `stats_incorrect` INT(5) NOT NULL default '0', `stats_percentage` INT(3) NOT NULL default '0');
So, I logged into my phpmyadmin for my domain and checked the tables. quiz_statistics was not there. hmmm. So, I tried to manually run the SQL commands. It shot back at me that the default for 'stats_id' was invalid. So, I changed '' to '0' and ran it again. This time, 'quiz_id' was invalid. Dur! so, I stuck in a 0 for the other ones that where only '' and ran it again. It looked like this:

Code: Select all

CREATE TABLE apdphpbb_quiz_statistics ( `stats_id` int(5) NOT NULL default '0', `quiz_id` int(10) NOT NULL default '0', `user_id` int(10) NOT NULL default '0', `stats_correct` INT(5) NOT NULL default '0', `stats_incorrect` INT(5) NOT NULL default '0', `stats_percentage` INT(3) NOT NULL default '0');
This time, eveything went through fine. I re-submitted my quiz and Tada! everything works great.

Again, thanks for the great mod, you have no idea how much this is going to help us.

Posted: Sat Sep 23, 2006 5:43 pm
by battye
I'm glad you fixed it, and I'm glad you like the MOD :)

I have the same problem

Posted: Sun Feb 25, 2007 8:33 pm
by djnoyze
I have the same problem, but I'm unsure of how you fixed it... What do I need to modify? I saw the same error you saw and kept on truckin' like an idiot.

I've tried to just reinstall the mod, but that didn't work either...

Here's my error:

An Error Occurred

DEBUG MODE

SQL Error : 1146 Table 'djnoyze.forum_quiz_statistics' doesn't exist

SELECT stats_id FROM forum_quiz_statistics ORDER BY stats_id DESC LIMIT 1

Line : 31
File : functions_quiz.php

Posted: Mon Feb 26, 2007 7:37 am
by battye
Have you tried running this (make sure to edit the table prefix first) in phpMyAdmin, like the above poster?

Code: Select all

CREATE TABLE apdphpbb_quiz_statistics ( `stats_id` int(5) NOT NULL default '0', `quiz_id` int(10) NOT NULL default '0', `user_id` int(10) NOT NULL default '0', `stats_correct` INT(5) NOT NULL default '0', `stats_incorrect` INT(5) NOT NULL default '0', `stats_percentage` INT(3) NOT NULL default '0');