SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How Are These Created - Process Flow

    Hi, i am working on a site at the moment and i am trying to allow customers to build their orders using a "drop down menu / wizard" where each drop drown menu displays content based on the choice in the previous drop down menu...

    As soon as a user chooses an option in the first drop down menu... a second drop down menu appears and the content is based on the users choice in the previous drop down... etc

    I presume this type of function uses ajax and queries the database each time a selection has been made in the drop down menu...

    Question 1: How should you design these in the database... do i need to create a single table for each option in the first drop down menu... or how should you design your product database
    Question 2: If the answer is YES to the first question... i obviously need to store the contents of each drop down menu in the table, but do i also need to store the actual text labels indicating what each drop down is for on the actual order form, as they will also change based on the choice in the previous drop down menu...

    I have spent the last hour trying to draw out what i mean below... these are not products i have on my site... i am just trying to demonstrate what i mean... i hope my diagram gives a better picture of what i am trying to achieve



    thanks in advance for your help...

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    were it me, i'd do it in 2 tables.
    1 table to hold the question chain
    1 table to hold the possible answers.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply... but how would you link them with one another considering there will be different paths...

  4. #4
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    Let's call my two tables Options and Questions
    Options are linked to questions directly.

    Code:
    Questions:
    ID Text
    1  "Yes or No"
    2  "Then Yes"
    3  "Then No"
    
    Options:
    Question_ID Next_Question_ID Text
    1                2                      "Yes"
    1                3                      "No"
    Last edited by StarLion; Sep 22, 2011 at 09:36. Reason: Decided on another approach
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •