gatez Posted December 2, 2007 Share Posted December 2, 2007 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; Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/ Share on other sites More sharing options...
gatez Posted December 3, 2007 Author Share Posted December 3, 2007 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/#findComment-404644 Share on other sites More sharing options...
fenway Posted December 3, 2007 Share Posted December 3, 2007 I don't understand what you're trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/#findComment-405060 Share on other sites More sharing options...
gatez Posted December 3, 2007 Author Share Posted December 3, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/#findComment-405243 Share on other sites More sharing options...
fenway Posted December 3, 2007 Share Posted December 3, 2007 I don't see how the answers relate to the ratings. Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/#findComment-405319 Share on other sites More sharing options...
gatez Posted December 4, 2007 Author Share Posted December 4, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/#findComment-405688 Share on other sites More sharing options...
fenway Posted December 4, 2007 Share Posted December 4, 2007 First, you're storing the answers to the questions in the questions table -- you need a separate table. Second, how do the ratings tie to the questions and answers? There isn't even a UID field in that table. Quote Link to comment https://forums.phpfreaks.com/topic/79888-msql-question/#findComment-406111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.