Search found 5 matches

by sm_558
Sun Apr 13, 2008 1:17 pm
Forum: PHP - Code
Topic: SELECT statement problem
Replies: 0
Views: 134

SELECT statement problem

Hi, im doing an editquiz functionality as part of my quiz management system. At the moment the forms prints out everything that is in the fields of the edit quiz form. I need to do a SELECT statement whivh compares the values in the fields to that in the database. If the user has changed anything i ...
by sm_558
Tue Apr 08, 2008 10:00 am
Forum: PHP - Code
Topic: Problem with sql insert quesry
Replies: 3
Views: 118

Re: Problem with sql insert quesry

You are defining a query variable but you never execute it. If you want to send this command into the mysql database you gotta do this $query = "INSERT INTO score (scoreID, username, score, quizID) VALUES (null, '$username', '$noCorrect', '$quizID')"; mysql_query($query); In order to veri...
by sm_558
Mon Apr 07, 2008 6:22 pm
Forum: PHP - Code
Topic: Problem with sql insert quesry
Replies: 3
Views: 118

Re: Problem with sql insert quesry

Also is there a way i can create a percentage for the scores? I know i need to do an answer count and a question count and divide, but im not sure how i would do it
by sm_558
Mon Apr 07, 2008 3:38 pm
Forum: PHP - Code
Topic: Problem with sql insert quesry
Replies: 3
Views: 118

Problem with sql insert quesry

I have the following code which scores a quiz after it has been submitted. The cript works but it doesnt insert the information into the databse. I tested the quiery in MySQL front and it does work, so its something wrong with my PHP script. Ive tried moving the query around but it does not work. <?...
by sm_558
Sun Apr 06, 2008 6:06 pm
Forum: PHP - Code
Topic: php quiz dilemma
Replies: 1
Views: 348

php quiz dilemma

Hi, i am having problems with the following code for a quiz. When the code is executed it prints out all the questions from the database along with the four answers related to it. Originally the form was outisde of the while loop but this would only let me select one radio button on the whole page. ...