Get column names from one table and values from another table in MySQL and show in a tabular view

I have two different tables 'products' & 'prod_attributes'. I am storing product column names in one table and product values in another table. I am doing this, because I have different products data like lights, fans, computers etc. and their columns names are different for each product. Their structure is as follows:

prod_attributes table

id  attr_name

1   Model No
2   Description
3   Watts
4   Lumen Output
5   TR Offer Lumen Output
6   Strip Lumen Output
7   Color Temp
8   Output Voltage
9   Certification
10  Warranty
11  Price

products table

id  prod_attributes_id  prod_attr_value
1   1                   ABC9801
2   2                   2FT LED T8 GLASS TUBE, DUAL END BYPASS
3   3                   10
4   4                   0
5   8                   1200
6   9                   3500K, 4000K, 5000K
7   9                   UL, DLC
8   10                  5 YEAR OR 50,000 WARRANTY
9   11                  5.95

Now, I want to show the products list in a tabular view like below:

Model No    Description             Watts   Lumen Output    TR Offer Lumen Output   Strip Lumen Output  Color Temp  Output Voltage  Certification   Warranty    Price

ABC9801     2FT LED T8 GLASS TUBE   10      0               N/A                     N/A                 N/A         1200            DLC             5 Yrs       5.95
UDH2837     Ceiling Fan             N/A     N/A             N/A                     N/A                 N/A         200             UL              1 Yrs       10.00

How can I write MySQL query to retrieve the data and show it in a tabular view in PHP.??

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum