Jump to content

creating a database using Checkbox to retrieve data from.


biology

Recommended Posts

Dear smart php programmer,

 

I have a very difficult situation. I want to create a database and retrieve specific data from through using Checkbox (if you don't mind to look at this database that I want to create such a style, and makes u understand what I want http://www.colby.edu/info.tech/BI211/PlantFamilyID.html ) I think it is better to use array but I don't know if that will work.

 

I am very grateful for a smart programmer to give me an idea or create a very simple example for me.

 

sincerely yours,

Start with a database structure.  These tables would support your application.  Once you understand these, you should be able to write some PHP code that utilizes them to create a set of scripts that would support a page like your example, both in emitting the survey, and recording the responses/answers when the form is filled out.

 

CREATE TABLE question (
    question_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    description VARCHAR(60),
    PRIMARY KEY (question_id)
);

CREATE TABLE choice (
    question_id INTEGER UNSIGNED NOT NULL,
    choice_id TINYINT NOT NULL,
    description VARCHAR(255),
    PRIMARY KEY (question_id, choice_id)
);

CREATE TABLE survey (
    survey_id VARCHAR(40) NOT NULL,
    taken TIMESTAMP,
    PRIMARY KEY (survey_id)
);

CREATE TABLE surveyAnswer (
    survey_id VARCHAR(40) NOT NULL,
    question_id INTEGER UNSIGNED NOT NULL,
    choice_id TINYINT NOT NULL,
    PRIMARY KEY (survey_id, question_id, choice_id)
);

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.