Jump to content

Recommended Posts

Hi everyone.

 

I've two MySQL tables (tbl_csv_input & tbl_qn_types).

 

Table Details:

1.  tbl_csv_input (qid, qname, qn_answer, qn_type) Primary Key = qid; Foreign Key = qn_type ref tbl_qn_types qn_type_id

2.  tbl_qn_types (qn_type_id, qn_type_name, notes) Primary Key = qn_type_id

 

Sample Data:

tbl_csv_input

1 ; Ferrari is the fastest car? ; Yes||No ; T1

2 ; Which below features would you like to have in you... ; Navigator||Airbag||Seat Belt||Camera & Sensors ; T1

3 ; Which model would you prefer? ; CX||MX||SX||LX ; T2

4 ; Comments ; ; T3

 

tbl_qn_types

T1; checkbox; This qn type is used for yes/no

T2; radio; Multiple options but only one is correct

T3; text area; Users enter input like comments

 

The whole idea is to have a questionnaire displayed in a HTML table depending upon the question types (T1, T2, T3)

In simple terms: You have a question and below it there are options.

Some questions have check boxes and some have radio buttons and some have text areas.

 

The problem I'm facing is with the column: qn_answer; and column = qn_type.

 

I'm unable to make a loop inside a table which is already in a loop.

 

Please see the attached files (which has the code I've written).

 

TIA.

 

 

 

 

 

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/251360-fixing-code-html-table-php-mysql/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.