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, Link to comment https://forums.phpfreaks.com/topic/154163-creating-a-database-using-checkbox-to-retrieve-data-from/ 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) ); Link to comment https://forums.phpfreaks.com/topic/154163-creating-a-database-using-checkbox-to-retrieve-data-from/#findComment-810414 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.