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,

Link to comment
Share on other sites

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)
);

 

 

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.