Display
|
| Posted: 04/19/2002, 6:04 AM |
|
I am struggling with the following: people fill in a questionnaire on my website. All results go into a MySQL database (I use PHP w/templates). A report is produced after a certain period of time. What I would like to get is sth like this:
Question 1:
Answer from person 1
Answer from person 2
Question 2:
Answer from person 1
Answer from person 2
.....
I managed to do that by creating a different form per question but this is not a good solution. Any idea on how to achieve this? I guess the solution is to write the right SQL statement but I have not been succesful so far...
Thanks!
|
|
|
 |
Nicole
|
| Posted: 04/19/2002, 6:39 AM |
|
Vince,
refer to Quiz example, namely to adminQuizResult page-> QuizR form. Use the same approach to display data from two table on one form.
Sample is available at: http://www.gotocode.com/art.asp?art_id=147&
|
|
|
 |
Vince
|
| Posted: 04/21/2002, 10:49 AM |
|
I am only using one table. The example that Nicole mentions therefore does not apply. So the problem I'm facing is a display problem; I still think this can be solved using the right SQL statement. Putting the data in arrays first? Any clue?
Thanks!
|
|
|
 |
Vince
|
| Posted: 04/21/2002, 9:04 PM |
|
Although your using MySQL maybe the following will apply, under SQL Server I'd write a stored proc build a string of responses (grouped, with html formatting) then use it a sub select for answers grouped by question.
Then I'd create one form add the question as a label and the anwers as a html label. The trick is getting the sql right but I don't see how this is do-able w/o using cursor in sql server, does MySql have similiar functionality.
|
|
|
 |
Mehmet Ozdemir
|
| Posted: 04/21/2002, 9:13 PM |
|
Vince,
That last reply was from me, maybe CodeChare needs to fix the Author Textbox so it's not freeform :)
|
|
|
 |