Error after taking quiz

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
BathroomNinja
Greenhorn
Greenhorn
Posts: 3
Joined: Sat Sep 23, 2006 3:59 am

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.
BathroomNinja
Greenhorn
Greenhorn
Posts: 3
Joined: Sat Sep 23, 2006 3:59 am

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.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

I'm glad you fixed it, and I'm glad you like the MOD :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
djnoyze
Greenhorn
Greenhorn
Posts: 1
Joined: Sun Feb 25, 2007 8:30 pm

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
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

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');
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
Post Reply