Need to build a SQL Query
I have two tables
tbl_cat
_________________
cat_id | cat_name
tbl_pro
__________________________
pro_id | pro_name | cat_id
now I need data in form of row
e.g
category name | pro name 1 | pro name 2 | pro name 3
OR
Category name | pro name 1 , pro name 2 , pro name 3
my Query is
SELECT ct.cat_name,
cp.proname
FROM tbl_cat ct
JOIN tbl_pro cp
WHERE ct.cat_id=cp.cat_id;
and it shows result like this
_____________________________
cat Name | Pro Name
cat Name | Pro Name 1
cat Name | Pro Name 2