I need to develop Feedback module in PHP/MySQL. I would like to know the database design and flow to manage this system.

There are questions for 2 tools which i need to store in my databse and need to create report like %of Positive Response, % of Negative Response, No. of Users for Tool1/2 etc.

I would like to how one can create for Question 2? I mean it based on first response, IF NO, then and then it should ask for WHY.

*It would be great if i have any similar example/code/link etc. *

**Thanks in advanced for your input. **

Tool 1

1. Are you satisfied with the performance of the tool ? Yes/No
2. Are you satisfied with the support provided? Yes/No
         IF NO, Why ?
3. If you need to improve, they are the three major changes you propose Yes/No 
         IF Yes, -----****----
4. What are the general points (up to 3) that you would like to improve on the project Yes/No 
         IF Yes, -----****----

Tool 2

1. Are you satisfied with the performance of the tool ? Yes/No
2. Are you satisfied with the support provided? Yes/No
         IF NO, Why ? -----****----
3. If you need to improve, they are the three major changes you propose Yes/No 
         IF Yes, -----****----
4. What are the general points (up to 3) that you would like to improve on the project Yes/No 
         IF Yes, -----****----

One approach:

  1. make a form for your questions
  2. use radio buttons for questions 1 and 2
  3. use a text input or text area for question 3, and enclose it in a hidden element (i.e. a div)
  4. attach a javascript function on the onclick event of the radio buttons for the question 2; the javascript should check which value was clicked: if yes, unhide the div for question 3; if no, hide the div for question 3

@broj1:

It sounds good. What about savings replys? How i can store in database?

In addition, i need to generate report by pie chart or something like that..

Member Avatar for diafol

My suggestion:
One form for the lot.
Use name arrays for fields, e.g. name="performance[0]" and name="performance[1]" etc. for tools 1 and 2. There are other ways to do this though.

How is your DB organised?

@diafol:

DB i need to design and manage. Which is the easy way to manage? I would like to keep technically simple as i am not expert. I am ready to do more work in simple way.

Well, in first section user will enter his/her name and email_id and then this form will come as second section.

At the end, he/she should get the thank you mail for the feedback.

What about savings replys? How i can store in database?

On furm submit save the answers. If second answer is yes, save also the third answer. Do an INSERT query to save to DB. Do not use mysql extension, use PDO or at least mysqli

In addition, i need to generate report by pie chart or something like that..

Use jqplot library or similar javascript library for generating charts

As Broj suggested don't use mysql extension instead use PDO or mysqli.It is deprecated as of PHP 5.5.0.Refer this

This extension is deprecated as of PHP 5.5.0, and is not recommended for writing new code as it will be removed in the future. Instead, either the mysqli or PDO_MySQL extension should be used. See also the MySQL API Overview for further help while choosing a MySQL API.

Although you can maintain everything in one table but it will contain redundant data and not normalized.

As for DB is concerned you can create 4 tables:-

Tool[tool_id(PK),tool_name,description(if required)]
User[user_id(PK),user_name,email_id,display_name(if registered user)]
Question[question_id(PK),question]
feedback[feedback_id,user_id,tool_id,question_id,comment,satisfaction(0 for No/1 for Yes)].

Something like this as per your need.

commented: good post! +12

Is it possile to get any tutorial/link/example/code which can be good reference for requirement ?

Member Avatar for diafol

Is it possile to get any tutorial/link/example/code which can be good reference for requirement ?

Are you not able to create a set of MySQL tables as suggested?

Are you not able to create a set of MySQL tables as suggested?

I did but i would like to have an example for Question 2 & 3.

Post the code you have so far. It is easier to built on existing code than make up everything from scratch.

Here is an example of using a jquery click event and checked selector:
http://api.jquery.com/checked-selector/ You can use this for showing/hiding a textarea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.