biology Posted April 15, 2009 Share Posted April 15, 2009 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, Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 15, 2009 Share Posted April 15, 2009 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) ); Quote Link to comment 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.