Jump to content

the_924

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

the_924's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If you include files based on $_GET variables, but require that the file is preceded by something like: "account/account." and ends with ".php"--is it safe?  There's no way to include files from another site, right? I think it's safe--just double checking--thanks :)
  2. Update: This is what I've gotten so far, [code]SELECT q.id, q.course_id, q.title, c.id, c.name FROM ft_quiz q, ft_course c WHERE q.course_id = c.id[/code] But it leaves out the quizzes that aren't attatched to a course; still working on it :D EDIT: [table] [tr][td][b]id [/b][/td][td][b]course_id    [/b][/td][td][b]title    [/b][/td][td][b]id    [/b][/td][td][b]name    [/b][/td][/tr] [tr][td]1[/td][td]1[/td][td]AP US Quiz[/td][td]1[/td][td]US History (AP)[/td][/tr] [tr][td]2[/td][td]0[/td][td]Quiz - No Course[/td][td]1[/td][td]US History (AP)[/td][/tr] [tr][td]2[/td][td]0[/td][td]Quiz - No Course[/td][td]2[/td][td]Euro History (AP)[/td][/tr] [/table]
  3. I have a situation with two tables: CREATE TABLE `quiz` (     id int (5) NOT NULL auto_increment,     title varchar(100) NOT NULL,     course_id INT(4) NOT NULL,     question_first_id INT(6) NOT NULL,     question_last_id INT(6) NOT NULL,     question_list text NOT NULL,     PRIMARY KEY (id) ); and CREATE TABLE `course` (     id int (5) NOT NULL auto_increment,     name varchar(100) NOT NULL,     description text NOT NULL,     PRIMARY KEY (id) ); I'm trying to query the Quiz table and generate a table that would, ideally, look something like this: [table] [tr][td][b]Quiz name    [/b][/td]    [td][b]Quiz course[/b][/td][/tr] [tr][td]Lesson 1[/td][td]AP Euro History[/td][/tr] [tr][td]Lesson 1[/td][td]AP US History[/td][/tr] [tr][td]Fun quiz[/td][td] - NO COURSE! -[/td][/tr] [/table] However, since I want the Course names, and not ID's, I need to "join" them together (I think); I want the query results to look like this: [table] [tr][td][b]quiz.id    [/b][/td]    [td][b]quiz.name    [/b][/td]    [td][b]course.name    [/b][/td][/tr] [tr][td]1[/td][td]Lesson 1[/td][td]AP Euro History[/td][/tr] [tr][td]2[/td][td]Lesson 1[/td][td]AP US History[/td][/tr] [tr][td]2[/td][td]Fun quiz[/td][td][/td][/tr] [/table]
  4. Would I be going to far with a plan like this: My teacher is having me make a site for him to post notes/quizzes/such for AP students, he plans to make a little extra cash using Google Ads; however, with all the traffic he wants, I'm confused as to how efficient my current idea for quizzes is. Here's the quiz mysql table: [code]CREATE TABLE `' . FT_MYSQL_PREFIX . 'quiz`                             (                             id int (5) NOT NULL auto_increment,                             title varchar(100) NOT NULL,                             question_first_id INT(6) NOT NULL,                             question_last_id INT(6) NOT NULL,                             question_list text NOT NULL,                             PRIMARY KEY (id)                             );[/code] And here's the question table: [code]CREATE TABLE `' . FT_MYSQL_PREFIX . 'quiz_question`                             (                             `id` INT(5) NOT NULL auto_increment,                             `question` TEXT NOT NULL,                             PRIMARY KEY (`id`)                             );[/code] Basically when you create a quiz, it batch adds all the quiz questions to the quiz question table, so you can add each individual question to a 'favorites' list to help you study later. The Quiz table stores a reference from the first question it added to the last, so it can still generate the same quiz. Is this a decent way to go about it? Any general suggestions about MySQL speed I may be missing?
×
×
  • 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.