I have Two Tables
Product : id,name
product_code : id,product_id,code
I want following output in PHP Mysql
Mobile : 1258,5697,569845
Computer : 5789,1467,58946
where mobile and computer is product name and numbers are product code... (concatenation of product code)
SELECT p.name,
c.code
FROM product AS p
INNER JOIN product_code AS c
ON p.id = c.product_id
Should do the trick, assuming its a one to one mapping