Jump to content

Msql question


gatez

Recommended Posts

i have a  php script that uses msql  its a quiz script

 

just wondering   

 

i go to  check the tables i got questions table

and ratings table

 

for the ratings table i got   min max ratings and then awnser

 

 

 

my question is this

 

say i have 5 questions with 5 different awnsers

based on how you awnser the questions it will give you a different overall awnser

 

how can i set this up ?

 

 

-- phpMyAdmin SQL Dump
-- version 2.11.0
-- http://www.phpmyadmin.net
--
-- Host: localhost.
-- Generation Time: Nov 10, 2007 at 02:50 AM
-- Server version: 5.0.24
-- PHP Version: 4.4.7

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `*********`
--

-- --------------------------------------------------------

--
-- Table structure for table `questions`
--

CREATE TABLE IF NOT EXISTS `questions` (
  `questions_id` tinyint(4) NOT NULL auto_increment,
  `questions_question` varchar(200) NOT NULL,
  `questions_option1` varchar(200) NOT NULL,
  `questions_option2` varchar(200) NOT NULL,
  `questions_option3` varchar(200) NOT NULL,
  `questions_option4` varchar(200) NOT NULL,
  `questions_option5` varchar(200) NOT NULL,
  PRIMARY KEY  (`questions_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `ratings`
--

CREATE TABLE IF NOT EXISTS `ratings` (
  `min` varchar(3) NOT NULL,
  `max` varchar(3) NOT NULL,
  `rating` varchar(100) NOT NULL,
  `description` varchar(1000) NOT NULL,
  `image` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

 

Link to comment
Share on other sites

Trying to set up a quiz script using php and the questions and ratings are in the database

my question was if i have 5 questions with 5 options

 

ex

 

Whats your name?

1.ted

2.frank

3.paul

4.sally

5.saul

 

Whats your name?

1.ted

2.frank

3.paul

4.sally

5.saul

 

Whats your name?

1.ted

2.frank

3.paul

4.sally

5.saul

 

 

and at the end based on what they awnserd they would get a rating

 

rating

based on the awnsers youare for shure a frank

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

questions table i put the questions

 

 

then there is the ratings table with min man and ratings

 

 

what i want is for the awnsers to have some sort of value

 

so say i awnser

 

for questions 12345 i awnser abcde

i can have pre set awnsers based on the questions thhat are awnserd

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.