tags:

views:

17

answers:

2

tables i am using

product_parameter

       
    id productid parameterid value
    1      1         1         10
    2      2         2         11
    3      1         2         34
    4      2         4         44
    5      3         2         55
    6      3         3         43
    7      4         1         33
    8      1         3         33
    9      1         4         24

and so on i want to display in form

         parameterid 1  2    3        4. . .
productid
1                    43 34   33       24
2                 null  11 null       44 
3
4
.
.

and so on rows and columns are not fixed

A: 

tables i am using

product_parameter

Sorry wanted to correct the output format i needed after query

id productid parameterid value
1      1         1         10
2      2         2         11
3      1         2         34
4      2         4         44
5      3         2         55
6      3         3         43
7      4         1         33
8      1         3         33
9      1         4         24

and so on i want to display in form

         parameterid 1  2    3        4. . .
productid
1                    43 34   33       24
2                 null  11 null       44 
3
4
.
.

and so on... rows and columns values are not fixed

ritu
You should edit your post instead of posting this as an answer. (I've already done you the favor, though.)
lc
A: 

It would be much easier to create 2D array in application code.

In SQL you have to add a join for each column.

Naktibalda